• Home
  • Raw
  • Download

Lines Matching full:cdns

26 static int set_phy_power_on(struct cdns *cdns)  in set_phy_power_on()  argument
30 ret = phy_power_on(cdns->usb2_phy); in set_phy_power_on()
34 ret = phy_power_on(cdns->usb3_phy); in set_phy_power_on()
36 phy_power_off(cdns->usb2_phy); in set_phy_power_on()
41 static void set_phy_power_off(struct cdns *cdns) in set_phy_power_off() argument
43 phy_power_off(cdns->usb3_phy); in set_phy_power_off()
44 phy_power_off(cdns->usb2_phy); in set_phy_power_off()
57 struct cdns *cdns; in cdns3_plat_probe() local
61 cdns = devm_kzalloc(dev, sizeof(*cdns), GFP_KERNEL); in cdns3_plat_probe()
62 if (!cdns) in cdns3_plat_probe()
65 cdns->dev = dev; in cdns3_plat_probe()
66 cdns->pdata = dev_get_platdata(dev); in cdns3_plat_probe()
68 platform_set_drvdata(pdev, cdns); in cdns3_plat_probe()
74 cdns->xhci_res[0].start = ret; in cdns3_plat_probe()
75 cdns->xhci_res[0].end = ret; in cdns3_plat_probe()
76 cdns->xhci_res[0].flags = IORESOURCE_IRQ | irq_get_trigger_type(ret); in cdns3_plat_probe()
77 cdns->xhci_res[0].name = "host"; in cdns3_plat_probe()
85 cdns->xhci_res[1] = *res; in cdns3_plat_probe()
87 cdns->dev_irq = platform_get_irq_byname(pdev, "peripheral"); in cdns3_plat_probe()
89 if (cdns->dev_irq < 0) in cdns3_plat_probe()
90 return cdns->dev_irq; in cdns3_plat_probe()
95 cdns->dev_regs = regs; in cdns3_plat_probe()
97 cdns->otg_irq = platform_get_irq_byname(pdev, "otg"); in cdns3_plat_probe()
98 if (cdns->otg_irq < 0) in cdns3_plat_probe()
99 return cdns->otg_irq; in cdns3_plat_probe()
107 cdns->phyrst_a_enable = device_property_read_bool(dev, "cdns,phyrst-a-enable"); in cdns3_plat_probe()
109 cdns->otg_res = *res; in cdns3_plat_probe()
111 cdns->wakeup_irq = platform_get_irq_byname_optional(pdev, "wakeup"); in cdns3_plat_probe()
112 if (cdns->wakeup_irq == -EPROBE_DEFER) in cdns3_plat_probe()
113 return cdns->wakeup_irq; in cdns3_plat_probe()
115 if (cdns->wakeup_irq < 0) { in cdns3_plat_probe()
117 cdns->wakeup_irq = 0x0; in cdns3_plat_probe()
120 cdns->usb2_phy = devm_phy_optional_get(dev, "cdns3,usb2-phy"); in cdns3_plat_probe()
121 if (IS_ERR(cdns->usb2_phy)) in cdns3_plat_probe()
122 return PTR_ERR(cdns->usb2_phy); in cdns3_plat_probe()
124 ret = phy_init(cdns->usb2_phy); in cdns3_plat_probe()
128 cdns->usb3_phy = devm_phy_optional_get(dev, "cdns3,usb3-phy"); in cdns3_plat_probe()
129 if (IS_ERR(cdns->usb3_phy)) in cdns3_plat_probe()
130 return PTR_ERR(cdns->usb3_phy); in cdns3_plat_probe()
132 ret = phy_init(cdns->usb3_phy); in cdns3_plat_probe()
136 ret = set_phy_power_on(cdns); in cdns3_plat_probe()
140 cdns->gadget_init = cdns3_gadget_init; in cdns3_plat_probe()
142 ret = cdns_init(cdns); in cdns3_plat_probe()
149 if (!(cdns->pdata && (cdns->pdata->quirks & CDNS3_DEFAULT_PM_RUNTIME_ALLOW))) in cdns3_plat_probe()
164 set_phy_power_off(cdns); in cdns3_plat_probe()
166 phy_exit(cdns->usb3_phy); in cdns3_plat_probe()
168 phy_exit(cdns->usb2_phy); in cdns3_plat_probe()
181 struct cdns *cdns = platform_get_drvdata(pdev); in cdns3_plat_remove() local
182 struct device *dev = cdns->dev; in cdns3_plat_remove()
187 cdns_remove(cdns); in cdns3_plat_remove()
188 set_phy_power_off(cdns); in cdns3_plat_remove()
189 phy_exit(cdns->usb2_phy); in cdns3_plat_remove()
190 phy_exit(cdns->usb3_phy); in cdns3_plat_remove()
198 struct cdns *cdns = dev_get_drvdata(dev); in cdns3_set_platform_suspend() local
201 if (cdns->pdata && cdns->pdata->platform_suspend) in cdns3_set_platform_suspend()
202 ret = cdns->pdata->platform_suspend(dev, suspend, wakeup); in cdns3_set_platform_suspend()
209 struct cdns *cdns = dev_get_drvdata(dev); in cdns3_controller_suspend() local
213 if (cdns->in_lpm) in cdns3_controller_suspend()
221 cdns3_set_platform_suspend(cdns->dev, true, wakeup); in cdns3_controller_suspend()
222 set_phy_power_off(cdns); in cdns3_controller_suspend()
223 spin_lock_irqsave(&cdns->lock, flags); in cdns3_controller_suspend()
224 cdns->in_lpm = true; in cdns3_controller_suspend()
225 spin_unlock_irqrestore(&cdns->lock, flags); in cdns3_controller_suspend()
226 dev_dbg(cdns->dev, "%s ends\n", __func__); in cdns3_controller_suspend()
233 struct cdns *cdns = dev_get_drvdata(dev); in cdns3_controller_resume() local
237 if (!cdns->in_lpm) in cdns3_controller_resume()
240 if (cdns_power_is_lost(cdns)) { in cdns3_controller_resume()
241 phy_exit(cdns->usb2_phy); in cdns3_controller_resume()
242 ret = phy_init(cdns->usb2_phy); in cdns3_controller_resume()
246 phy_exit(cdns->usb3_phy); in cdns3_controller_resume()
247 ret = phy_init(cdns->usb3_phy); in cdns3_controller_resume()
252 ret = set_phy_power_on(cdns); in cdns3_controller_resume()
256 cdns3_set_platform_suspend(cdns->dev, false, false); in cdns3_controller_resume()
258 spin_lock_irqsave(&cdns->lock, flags); in cdns3_controller_resume()
259 cdns_resume(cdns); in cdns3_controller_resume()
260 cdns->in_lpm = false; in cdns3_controller_resume()
261 spin_unlock_irqrestore(&cdns->lock, flags); in cdns3_controller_resume()
262 cdns_set_active(cdns, !PMSG_IS_AUTO(msg)); in cdns3_controller_resume()
263 if (cdns->wakeup_pending) { in cdns3_controller_resume()
264 cdns->wakeup_pending = false; in cdns3_controller_resume()
265 enable_irq(cdns->wakeup_irq); in cdns3_controller_resume()
267 dev_dbg(cdns->dev, "%s ends\n", __func__); in cdns3_controller_resume()
286 struct cdns *cdns = dev_get_drvdata(dev); in cdns3_plat_suspend() local
289 cdns_suspend(cdns); in cdns3_plat_suspend()
295 if (device_may_wakeup(dev) && cdns->wakeup_irq) in cdns3_plat_suspend()
296 enable_irq_wake(cdns->wakeup_irq); in cdns3_plat_suspend()
316 { .compatible = "cdns,usb3" },
326 .name = "cdns-usb3",