Lines Matching defs:xhci
3 * xhci-plat.c - xHCI host controller driver platform Bus Glue.
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)
79 struct xhci_plat_priv *priv = xhci_to_priv(xhci);
81 xhci->quirks |= priv->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;
190 xhci = hcd_to_xhci(hcd);
192 xhci->allow_single_roothub = 1;
198 xhci->reg_clk = devm_clk_get_optional(&pdev->dev, "reg");
199 if (IS_ERR(xhci->reg_clk)) {
200 ret = PTR_ERR(xhci->reg_clk);
204 xhci->clk = devm_clk_get_optional(&pdev->dev, NULL);
205 if (IS_ERR(xhci->clk)) {
206 ret = PTR_ERR(xhci->clk);
210 xhci->reset = devm_reset_control_array_get_optional_shared(&pdev->dev);
211 if (IS_ERR(xhci->reset)) {
212 ret = PTR_ERR(xhci->reset);
216 ret = reset_control_deassert(xhci->reset);
220 ret = clk_prepare_enable(xhci->reg_clk);
224 ret = clk_prepare_enable(xhci->clk);
236 xhci->main_hcd = hcd;
239 xhci->imod_interval = 40000;
245 xhci->quirks |= XHCI_HW_LPM_DISABLE;
248 xhci->quirks |= XHCI_LPM_SUPPORT;
251 xhci->quirks |= XHCI_BROKEN_PORT_PED;
253 if (device_property_read_bool(tmpdev, "xhci-sg-trb-cache-size-quirk"))
254 xhci->quirks |= XHCI_SG_TRB_CACHE_SIZE_QUIRK;
257 &xhci->imod_interval);
262 * matching for the xhci platform device).
285 xhci->quirks |= XHCI_SG_TRB_CACHE_SIZE_QUIRK;
291 if (!xhci_has_one_roothub(xhci)) {
292 xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev,
294 if (!xhci->shared_hcd) {
300 xhci->shared_hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev,
302 if (IS_ERR(xhci->shared_hcd->usb_phy)) {
303 xhci->shared_hcd->usb_phy = NULL;
305 ret = usb_phy_init(xhci->shared_hcd->usb_phy);
312 xhci->shared_hcd->tpl_support = hcd->tpl_support;
315 usb3_hcd = xhci_get_usb3_hcd(xhci);
316 if (usb3_hcd && HCC_MAX_PSA(xhci->hcc_params) >= 4)
319 if (xhci->shared_hcd) {
320 ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
338 usb_put_hcd(xhci->shared_hcd);
347 clk_disable_unprepare(xhci->clk);
350 clk_disable_unprepare(xhci->reg_clk);
353 reset_control_assert(xhci->reset);
408 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
409 struct clk *clk = xhci->clk;
410 struct clk *reg_clk = xhci->reg_clk;
411 struct usb_hcd *shared_hcd = xhci->shared_hcd;
413 xhci->xhc_state |= XHCI_STATE_REMOVING;
418 xhci->shared_hcd = NULL;
430 reset_control_assert(xhci->reset);
442 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
455 ret = xhci_suspend(xhci, device_may_wakeup(dev));
459 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) {
460 clk_disable_unprepare(xhci->clk);
461 clk_disable_unprepare(xhci->reg_clk);
470 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
473 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) {
474 ret = clk_prepare_enable(xhci->clk);
478 ret = clk_prepare_enable(xhci->reg_clk);
480 clk_disable_unprepare(xhci->clk);
489 ret = xhci_resume(xhci, pmsg);
500 if (!device_may_wakeup(dev) && (xhci->quirks & XHCI_SUSPEND_RESUME_CLKS)) {
501 clk_disable_unprepare(xhci->clk);
502 clk_disable_unprepare(xhci->reg_clk);
521 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
528 return xhci_suspend(xhci, true);
534 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
536 return xhci_resume(xhci, PMSG_AUTO_RESUME);
567 .name = "xhci-hcd",
573 MODULE_ALIAS("platform:xhci-hcd");