Lines Matching full:xhci
3 * xhci-plat.c - xHCI host controller driver platform Bus Glue.
8 * A lot of code borrowed from the Linux xHCI driver.
23 #include "xhci.h"
24 #include "xhci-plat.h"
25 #include "xhci-mvebu.h"
26 #include "xhci-rcar.h"
87 static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci) in xhci_plat_quirks() argument
89 struct xhci_plat_priv *priv = xhci_to_priv(xhci); in xhci_plat_quirks()
96 xhci->quirks |= XHCI_PLAT | priv->quirks; in xhci_plat_quirks()
142 .compatible = "generic-xhci",
144 .compatible = "xhci-platform",
146 .compatible = "marvell,armada-375-xhci",
149 .compatible = "marvell,armada-380-xhci",
152 .compatible = "marvell,armada3700-xhci",
155 .compatible = "renesas,xhci-r8a7790",
158 .compatible = "renesas,xhci-r8a7791",
161 .compatible = "renesas,xhci-r8a7793",
164 .compatible = "renesas,xhci-r8a7795",
167 .compatible = "renesas,xhci-r8a7796",
170 .compatible = "renesas,rcar-gen2-xhci",
173 .compatible = "renesas,rcar-gen3-xhci",
176 .compatible = "brcm,xhci-brcm-v2",
179 .compatible = "brcm,bcm7445-xhci",
192 struct xhci_hcd *xhci; in xhci_plat_probe() local
264 xhci = hcd_to_xhci(hcd); in xhci_plat_probe()
270 xhci->reg_clk = devm_clk_get_optional(&pdev->dev, "reg"); in xhci_plat_probe()
271 if (IS_ERR(xhci->reg_clk)) { in xhci_plat_probe()
272 ret = PTR_ERR(xhci->reg_clk); in xhci_plat_probe()
276 ret = clk_prepare_enable(xhci->reg_clk); in xhci_plat_probe()
280 xhci->clk = devm_clk_get_optional(&pdev->dev, NULL); in xhci_plat_probe()
281 if (IS_ERR(xhci->clk)) { in xhci_plat_probe()
282 ret = PTR_ERR(xhci->clk); in xhci_plat_probe()
286 ret = clk_prepare_enable(xhci->clk); in xhci_plat_probe()
303 xhci->main_hcd = hcd; in xhci_plat_probe()
304 xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev, in xhci_plat_probe()
306 if (!xhci->shared_hcd) { in xhci_plat_probe()
312 xhci->imod_interval = 40000; in xhci_plat_probe()
318 xhci->quirks |= XHCI_HW_LPM_DISABLE; in xhci_plat_probe()
321 xhci->quirks |= XHCI_LPM_SUPPORT; in xhci_plat_probe()
324 xhci->quirks |= XHCI_BROKEN_PORT_PED; in xhci_plat_probe()
326 if (device_property_read_bool(tmpdev, "xhci-sg-trb-cache-size-quirk")) in xhci_plat_probe()
327 xhci->quirks |= XHCI_SG_TRB_CACHE_SIZE_QUIRK; in xhci_plat_probe()
330 &xhci->imod_interval); in xhci_plat_probe()
346 xhci->shared_hcd->tpl_support = hcd->tpl_support; in xhci_plat_probe()
354 if ((xhci->quirks & XHCI_SKIP_PHY_INIT) || (priv && (priv->quirks & XHCI_SKIP_PHY_INIT))) in xhci_plat_probe()
358 xhci->quirks |= XHCI_SG_TRB_CACHE_SIZE_QUIRK; in xhci_plat_probe()
364 if (HCC_MAX_PSA(xhci->hcc_params) >= 4) in xhci_plat_probe()
365 xhci->shared_hcd->can_do_streams = 1; in xhci_plat_probe()
367 ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); in xhci_plat_probe()
390 usb_put_hcd(xhci->shared_hcd); in xhci_plat_probe()
393 clk_disable_unprepare(xhci->clk); in xhci_plat_probe()
396 clk_disable_unprepare(xhci->reg_clk); in xhci_plat_probe()
411 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_remove() local
412 struct clk *clk = xhci->clk; in xhci_plat_remove()
413 struct clk *reg_clk = xhci->reg_clk; in xhci_plat_remove()
414 struct usb_hcd *shared_hcd = xhci->shared_hcd; in xhci_plat_remove()
417 xhci->xhc_state |= XHCI_STATE_REMOVING; in xhci_plat_remove()
420 xhci->shared_hcd = NULL; in xhci_plat_remove()
440 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_suspend() local
453 ret = xhci_suspend(xhci, device_may_wakeup(dev)); in xhci_plat_suspend()
457 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) { in xhci_plat_suspend()
458 clk_disable_unprepare(xhci->clk); in xhci_plat_suspend()
459 clk_disable_unprepare(xhci->reg_clk); in xhci_plat_suspend()
468 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_resume() local
471 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) { in xhci_plat_resume()
472 ret = clk_prepare_enable(xhci->clk); in xhci_plat_resume()
476 ret = clk_prepare_enable(xhci->reg_clk); in xhci_plat_resume()
478 clk_disable_unprepare(xhci->clk); in xhci_plat_resume()
487 ret = xhci_resume(xhci, 0); in xhci_plat_resume()
498 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) { in xhci_plat_resume()
499 clk_disable_unprepare(xhci->clk); in xhci_plat_resume()
500 clk_disable_unprepare(xhci->reg_clk); in xhci_plat_resume()
509 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_runtime_suspend() local
516 return xhci_suspend(xhci, true); in xhci_plat_runtime_suspend()
522 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_runtime_resume() local
524 return xhci_resume(xhci, 0); in xhci_plat_runtime_resume()
537 /* XHCI-compliant USB Controller */
549 .name = "xhci-hcd",
555 MODULE_ALIAS("platform:xhci-hcd");
570 MODULE_DESCRIPTION("xHCI Platform Host Controller Driver");