Skip to content

Commit 9f5e526

Browse files
Peter Chenksacilotto
authored andcommitted
usb: host: xhci-plat: add priv quirk for skip PHY initialization
BugLink: https://bugs.launchpad.net/bugs/1916066 commit f768e71 upstream. Some DRD controllers (eg, dwc3 & cdns3) have PHY management at their own driver to cover both device and host mode, so add one priv quirk for such users to skip PHY management from HCD core. Reviewed-by: Jun Li <jun.li@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200918131752.16488-5-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 5bab68a commit 9f5e526

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

drivers/usb/host/xhci-plat.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ static int xhci_plat_probe(struct platform_device *pdev)
163163
struct usb_hcd *hcd;
164164
int ret;
165165
int irq;
166+
struct xhci_plat_priv *priv = NULL;
167+
166168

167169
if (usb_disabled())
168170
return -ENODEV;
@@ -257,8 +259,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
257259

258260
priv_match = of_device_get_match_data(&pdev->dev);
259261
if (priv_match) {
260-
struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
261-
262+
priv = hcd_to_xhci_priv(hcd);
262263
/* Just copy data for now */
263264
if (priv_match)
264265
*priv = *priv_match;
@@ -307,6 +308,9 @@ static int xhci_plat_probe(struct platform_device *pdev)
307308

308309
hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node);
309310
xhci->shared_hcd->tpl_support = hcd->tpl_support;
311+
if (priv && (priv->quirks & XHCI_SKIP_PHY_INIT))
312+
hcd->skip_phy_initialization = 1;
313+
310314
ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
311315
if (ret)
312316
goto disable_usb_phy;

drivers/usb/host/xhci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,6 +1873,7 @@ struct xhci_hcd {
18731873
#define XHCI_DEFAULT_PM_RUNTIME_ALLOW BIT_ULL(33)
18741874
#define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34)
18751875
#define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35)
1876+
#define XHCI_SKIP_PHY_INIT BIT_ULL(37)
18761877
#define XHCI_DISABLE_SPARSE BIT_ULL(38)
18771878

18781879
unsigned int num_active_eps;

0 commit comments

Comments
 (0)