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.
24 #include "xhci.h"
25 #include "xhci-plat.h"
26 #include "xhci-mvebu.h"
77 static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci) in xhci_plat_quirks() argument
79 struct xhci_plat_priv *priv = xhci_to_priv(xhci); in xhci_plat_quirks()
81 xhci->quirks |= priv->quirks; in xhci_plat_quirks()
118 .compatible = "generic-xhci",
120 .compatible = "xhci-platform",
122 .compatible = "marvell,armada-375-xhci",
125 .compatible = "marvell,armada-380-xhci",
128 .compatible = "marvell,armada3700-xhci",
131 .compatible = "brcm,xhci-brcm-v2",
134 .compatible = "brcm,bcm7445-xhci",
146 struct xhci_hcd *xhci; in xhci_plat_probe() local
190 xhci = hcd_to_xhci(hcd); in xhci_plat_probe()
192 xhci->allow_single_roothub = 1; in xhci_plat_probe()
198 xhci->reg_clk = devm_clk_get_optional(&pdev->dev, "reg"); in xhci_plat_probe()
199 if (IS_ERR(xhci->reg_clk)) { in xhci_plat_probe()
200 ret = PTR_ERR(xhci->reg_clk); in xhci_plat_probe()
204 xhci->clk = devm_clk_get_optional(&pdev->dev, NULL); in xhci_plat_probe()
205 if (IS_ERR(xhci->clk)) { in xhci_plat_probe()
206 ret = PTR_ERR(xhci->clk); in xhci_plat_probe()
210 xhci->reset = devm_reset_control_array_get_optional_shared(&pdev->dev); in xhci_plat_probe()
211 if (IS_ERR(xhci->reset)) { in xhci_plat_probe()
212 ret = PTR_ERR(xhci->reset); in xhci_plat_probe()
216 ret = reset_control_deassert(xhci->reset); in xhci_plat_probe()
220 ret = clk_prepare_enable(xhci->reg_clk); in xhci_plat_probe()
224 ret = clk_prepare_enable(xhci->clk); in xhci_plat_probe()
236 xhci->main_hcd = hcd; in xhci_plat_probe()
239 xhci->imod_interval = 40000; in xhci_plat_probe()
245 xhci->quirks |= XHCI_HW_LPM_DISABLE; in xhci_plat_probe()
248 xhci->quirks |= XHCI_LPM_SUPPORT; in xhci_plat_probe()
251 xhci->quirks |= XHCI_BROKEN_PORT_PED; in xhci_plat_probe()
253 if (device_property_read_bool(tmpdev, "xhci-sg-trb-cache-size-quirk")) in xhci_plat_probe()
254 xhci->quirks |= XHCI_SG_TRB_CACHE_SIZE_QUIRK; in xhci_plat_probe()
257 &xhci->imod_interval); in xhci_plat_probe()
262 * matching for the xhci platform device). in xhci_plat_probe()
285 xhci->quirks |= XHCI_SG_TRB_CACHE_SIZE_QUIRK; in xhci_plat_probe()
291 if (!xhci_has_one_roothub(xhci)) { in xhci_plat_probe()
292 xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev, in xhci_plat_probe()
294 if (!xhci->shared_hcd) { in xhci_plat_probe()
300 xhci->shared_hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, in xhci_plat_probe()
302 if (IS_ERR(xhci->shared_hcd->usb_phy)) { in xhci_plat_probe()
303 xhci->shared_hcd->usb_phy = NULL; in xhci_plat_probe()
305 ret = usb_phy_init(xhci->shared_hcd->usb_phy); in xhci_plat_probe()
312 xhci->shared_hcd->tpl_support = hcd->tpl_support; in xhci_plat_probe()
315 usb3_hcd = xhci_get_usb3_hcd(xhci); in xhci_plat_probe()
316 if (usb3_hcd && HCC_MAX_PSA(xhci->hcc_params) >= 4) in xhci_plat_probe()
319 if (xhci->shared_hcd) { in xhci_plat_probe()
320 ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); in xhci_plat_probe()
338 usb_put_hcd(xhci->shared_hcd); in xhci_plat_probe()
347 clk_disable_unprepare(xhci->clk); in xhci_plat_probe()
350 clk_disable_unprepare(xhci->reg_clk); in xhci_plat_probe()
353 reset_control_assert(xhci->reset); in xhci_plat_probe()
408 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_remove() local
409 struct clk *clk = xhci->clk; in xhci_plat_remove()
410 struct clk *reg_clk = xhci->reg_clk; in xhci_plat_remove()
411 struct usb_hcd *shared_hcd = xhci->shared_hcd; in xhci_plat_remove()
413 xhci->xhc_state |= XHCI_STATE_REMOVING; in xhci_plat_remove()
418 xhci->shared_hcd = NULL; in xhci_plat_remove()
430 reset_control_assert(xhci->reset); in xhci_plat_remove()
442 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_suspend() local
455 ret = xhci_suspend(xhci, device_may_wakeup(dev)); in xhci_plat_suspend()
459 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) { in xhci_plat_suspend()
460 clk_disable_unprepare(xhci->clk); in xhci_plat_suspend()
461 clk_disable_unprepare(xhci->reg_clk); in xhci_plat_suspend()
470 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_resume_common() local
473 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) { in xhci_plat_resume_common()
474 ret = clk_prepare_enable(xhci->clk); in xhci_plat_resume_common()
478 ret = clk_prepare_enable(xhci->reg_clk); in xhci_plat_resume_common()
480 clk_disable_unprepare(xhci->clk); in xhci_plat_resume_common()
489 ret = xhci_resume(xhci, pmsg); in xhci_plat_resume_common()
500 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) { in xhci_plat_resume_common()
501 clk_disable_unprepare(xhci->clk); in xhci_plat_resume_common()
502 clk_disable_unprepare(xhci->reg_clk); in xhci_plat_resume_common()
521 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_runtime_suspend() local
528 return xhci_suspend(xhci, true); in xhci_plat_runtime_suspend()
534 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_runtime_resume() local
536 return xhci_resume(xhci, PMSG_AUTO_RESUME); in xhci_plat_runtime_resume()
555 /* XHCI-compliant USB Controller */
567 .name = "xhci-hcd",
573 MODULE_ALIAS("platform:xhci-hcd");
588 MODULE_DESCRIPTION("xHCI Platform Host Controller Driver");