Skip to content

Commit f768e71

Browse files
Peter Chengregkh
authored andcommitted
usb: host: xhci-plat: add priv quirk for skip PHY initialization
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 <[email protected]> Signed-off-by: Peter Chen <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 93cb8f1 commit f768e71

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
@@ -183,6 +183,8 @@ static int xhci_plat_probe(struct platform_device *pdev)
183183
struct usb_hcd *hcd;
184184
int ret;
185185
int irq;
186+
struct xhci_plat_priv *priv = NULL;
187+
186188

187189
if (usb_disabled())
188190
return -ENODEV;
@@ -280,8 +282,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
280282
priv_match = dev_get_platdata(&pdev->dev);
281283

282284
if (priv_match) {
283-
struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
284-
285+
priv = hcd_to_xhci_priv(hcd);
285286
/* Just copy data for now */
286287
*priv = *priv_match;
287288
}
@@ -329,6 +330,9 @@ static int xhci_plat_probe(struct platform_device *pdev)
329330

330331
hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node);
331332
xhci->shared_hcd->tpl_support = hcd->tpl_support;
333+
if (priv && (priv->quirks & XHCI_SKIP_PHY_INIT))
334+
hcd->skip_phy_initialization = 1;
335+
332336
ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
333337
if (ret)
334338
goto disable_usb_phy;

drivers/usb/host/xhci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,6 +1876,7 @@ struct xhci_hcd {
18761876
#define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34)
18771877
#define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35)
18781878
#define XHCI_RENESAS_FW_QUIRK BIT_ULL(36)
1879+
#define XHCI_SKIP_PHY_INIT BIT_ULL(37)
18791880

18801881
unsigned int num_active_eps;
18811882
unsigned int limit_active_eps;

0 commit comments

Comments
 (0)