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,bcm2711-xhci",
137 .compatible = "brcm,bcm7445-xhci",
149 struct xhci_hcd *xhci; in xhci_plat_probe() local
193 xhci = hcd_to_xhci(hcd); in xhci_plat_probe()
195 xhci->allow_single_roothub = 1; in xhci_plat_probe()
201 xhci->reg_clk = devm_clk_get_optional(&pdev->dev, "reg"); in xhci_plat_probe()
202 if (IS_ERR(xhci->reg_clk)) { in xhci_plat_probe()
203 ret = PTR_ERR(xhci->reg_clk); in xhci_plat_probe()
207 xhci->clk = devm_clk_get_optional(&pdev->dev, NULL); in xhci_plat_probe()
208 if (IS_ERR(xhci->clk)) { in xhci_plat_probe()
209 ret = PTR_ERR(xhci->clk); in xhci_plat_probe()
213 xhci->reset = devm_reset_control_array_get_optional_shared(&pdev->dev); in xhci_plat_probe()
214 if (IS_ERR(xhci->reset)) { in xhci_plat_probe()
215 ret = PTR_ERR(xhci->reset); in xhci_plat_probe()
219 ret = reset_control_deassert(xhci->reset); in xhci_plat_probe()
223 ret = clk_prepare_enable(xhci->reg_clk); in xhci_plat_probe()
227 ret = clk_prepare_enable(xhci->clk); in xhci_plat_probe()
239 xhci->main_hcd = hcd; in xhci_plat_probe()
242 xhci->imod_interval = 40000; in xhci_plat_probe()
248 xhci->quirks |= XHCI_HW_LPM_DISABLE; in xhci_plat_probe()
251 xhci->quirks |= XHCI_LPM_SUPPORT; in xhci_plat_probe()
254 xhci->quirks |= XHCI_BROKEN_PORT_PED; in xhci_plat_probe()
256 if (device_property_read_bool(tmpdev, "xhci-sg-trb-cache-size-quirk")) in xhci_plat_probe()
257 xhci->quirks |= XHCI_SG_TRB_CACHE_SIZE_QUIRK; in xhci_plat_probe()
260 xhci->quirks |= XHCI_WRITE_64_HI_LO; in xhci_plat_probe()
262 if (device_property_read_bool(tmpdev, "xhci-missing-cas-quirk")) in xhci_plat_probe()
263 xhci->quirks |= XHCI_MISSING_CAS; in xhci_plat_probe()
265 if (device_property_read_bool(tmpdev, "xhci-skip-phy-init-quirk")) in xhci_plat_probe()
266 xhci->quirks |= XHCI_SKIP_PHY_INIT; in xhci_plat_probe()
269 &xhci->imod_interval); in xhci_plat_probe()
274 * matching for the xhci platform device). in xhci_plat_probe()
297 xhci->quirks |= XHCI_SG_TRB_CACHE_SIZE_QUIRK; in xhci_plat_probe()
303 if (!xhci_has_one_roothub(xhci)) { 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->shared_hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, in xhci_plat_probe()
314 if (IS_ERR(xhci->shared_hcd->usb_phy)) { in xhci_plat_probe()
315 xhci->shared_hcd->usb_phy = NULL; in xhci_plat_probe()
317 ret = usb_phy_init(xhci->shared_hcd->usb_phy); in xhci_plat_probe()
324 xhci->shared_hcd->tpl_support = hcd->tpl_support; in xhci_plat_probe()
327 usb3_hcd = xhci_get_usb3_hcd(xhci); in xhci_plat_probe()
328 if (usb3_hcd && HCC_MAX_PSA(xhci->hcc_params) >= 4) in xhci_plat_probe()
331 if (xhci->shared_hcd) { in xhci_plat_probe()
332 ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); in xhci_plat_probe()
350 usb_put_hcd(xhci->shared_hcd); in xhci_plat_probe()
359 clk_disable_unprepare(xhci->clk); in xhci_plat_probe()
362 clk_disable_unprepare(xhci->reg_clk); in xhci_plat_probe()
365 reset_control_assert(xhci->reset); in xhci_plat_probe()
420 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_remove() local
421 struct clk *clk = xhci->clk; in xhci_plat_remove()
422 struct clk *reg_clk = xhci->reg_clk; in xhci_plat_remove()
423 struct usb_hcd *shared_hcd = xhci->shared_hcd; in xhci_plat_remove()
425 xhci->xhc_state |= XHCI_STATE_REMOVING; in xhci_plat_remove()
430 xhci->shared_hcd = NULL; in xhci_plat_remove()
442 reset_control_assert(xhci->reset); in xhci_plat_remove()
454 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_suspend() local
467 ret = xhci_suspend(xhci, device_may_wakeup(dev)); in xhci_plat_suspend()
471 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) { in xhci_plat_suspend()
472 clk_disable_unprepare(xhci->clk); in xhci_plat_suspend()
473 clk_disable_unprepare(xhci->reg_clk); in xhci_plat_suspend()
482 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_resume_common() local
485 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) { in xhci_plat_resume_common()
486 ret = clk_prepare_enable(xhci->clk); in xhci_plat_resume_common()
490 ret = clk_prepare_enable(xhci->reg_clk); in xhci_plat_resume_common()
492 clk_disable_unprepare(xhci->clk); in xhci_plat_resume_common()
501 ret = xhci_resume(xhci, pmsg); in xhci_plat_resume_common()
512 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) { in xhci_plat_resume_common()
513 clk_disable_unprepare(xhci->clk); in xhci_plat_resume_common()
514 clk_disable_unprepare(xhci->reg_clk); in xhci_plat_resume_common()
533 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_runtime_suspend() local
540 return xhci_suspend(xhci, true); in xhci_plat_runtime_suspend()
546 struct xhci_hcd *xhci = hcd_to_xhci(hcd); in xhci_plat_runtime_resume() local
548 return xhci_resume(xhci, PMSG_AUTO_RESUME); in xhci_plat_runtime_resume()
567 /* XHCI-compliant USB Controller */
579 .name = "xhci-hcd",
585 MODULE_ALIAS("platform:xhci-hcd");
600 MODULE_DESCRIPTION("xHCI Platform Host Controller Driver");