Lines Matching refs:cdns
1913 struct cdns *cdns = dev_get_drvdata(priv_dev->dev); in cdns3_device_irq_handler() local
1917 if (cdns->in_lpm) in cdns3_device_irq_handler()
3240 static void cdns3_gadget_exit(struct cdns *cdns) in cdns3_gadget_exit() argument
3244 priv_dev = cdns->gadget_dev; in cdns3_gadget_exit()
3247 pm_runtime_mark_last_busy(cdns->dev); in cdns3_gadget_exit()
3248 pm_runtime_put_autosuspend(cdns->dev); in cdns3_gadget_exit()
3251 devm_free_irq(cdns->dev, cdns->dev_irq, priv_dev); in cdns3_gadget_exit()
3274 cdns->gadget_dev = NULL; in cdns3_gadget_exit()
3275 cdns_drd_gadget_off(cdns); in cdns3_gadget_exit()
3278 static int cdns3_gadget_start(struct cdns *cdns) in cdns3_gadget_start() argument
3288 usb_initialize_gadget(cdns->dev, &priv_dev->gadget, in cdns3_gadget_start()
3290 cdns->gadget_dev = priv_dev; in cdns3_gadget_start()
3291 priv_dev->sysdev = cdns->dev; in cdns3_gadget_start()
3292 priv_dev->dev = cdns->dev; in cdns3_gadget_start()
3293 priv_dev->regs = cdns->dev_regs; in cdns3_gadget_start()
3307 max_speed = usb_get_maximum_speed(cdns->dev); in cdns3_gadget_start()
3316 dev_err(cdns->dev, "invalid maximum_speed parameter %d\n", in cdns3_gadget_start()
3331 priv_dev->gadget.irq = cdns->dev_irq; in cdns3_gadget_start()
3404 cdns->gadget_dev = NULL; in cdns3_gadget_start()
3408 static int __cdns3_gadget_init(struct cdns *cdns) in __cdns3_gadget_init() argument
3413 ret = dma_set_mask_and_coherent(cdns->dev, DMA_BIT_MASK(32)); in __cdns3_gadget_init()
3415 dev_err(cdns->dev, "Failed to set dma mask: %d\n", ret); in __cdns3_gadget_init()
3419 cdns_drd_gadget_on(cdns); in __cdns3_gadget_init()
3420 pm_runtime_get_sync(cdns->dev); in __cdns3_gadget_init()
3422 ret = cdns3_gadget_start(cdns); in __cdns3_gadget_init()
3424 pm_runtime_put_sync(cdns->dev); in __cdns3_gadget_init()
3432 ret = devm_request_threaded_irq(cdns->dev, cdns->dev_irq, in __cdns3_gadget_init()
3435 IRQF_SHARED, dev_name(cdns->dev), in __cdns3_gadget_init()
3436 cdns->gadget_dev); in __cdns3_gadget_init()
3443 cdns3_gadget_exit(cdns); in __cdns3_gadget_init()
3447 static int cdns3_gadget_suspend(struct cdns *cdns, bool do_wakeup) in cdns3_gadget_suspend() argument
3448 __must_hold(&cdns->lock) in cdns3_gadget_suspend()
3450 struct cdns3_device *priv_dev = cdns->gadget_dev; in cdns3_gadget_suspend()
3452 spin_unlock(&cdns->lock); in cdns3_gadget_suspend()
3454 spin_lock(&cdns->lock); in cdns3_gadget_suspend()
3466 static int cdns3_gadget_resume(struct cdns *cdns, bool hibernated) in cdns3_gadget_resume() argument
3468 struct cdns3_device *priv_dev = cdns->gadget_dev; in cdns3_gadget_resume()
3487 int cdns3_gadget_init(struct cdns *cdns) in cdns3_gadget_init() argument
3491 rdrv = devm_kzalloc(cdns->dev, sizeof(*rdrv), GFP_KERNEL); in cdns3_gadget_init()
3501 cdns->roles[USB_ROLE_DEVICE] = rdrv; in cdns3_gadget_init()