From a5bc56f4b76e9088af65c1b7bbc13676a34834dd Mon Sep 17 00:00:00 2001 From: William Wu Date: Tue, 30 Mar 2021 11:32:33 +0800 Subject: [PATCH] usb: dwc3: host: workaround xhci u2 broken suspend for RK356X The RK356X DWC3 supports to set the USB 2.0 PHY enter suspend mode if the DWC3 core suspend conditions are valid (as per DWC3 controller databook 6.3.46 GUSB2PHYCFG register bit6). This cause xHC driver failed to send USB resume signal to USB 2.0 device in xhci_bus_resume(). This patch adds a quirk "xhci-u2-broken-suspend" to force the xHC to set the link state to XDEV_RESUME and send USB resume signal to USB 2.0 device. Change-Id: I24c017867f80728890c0562a12e4554625913e67 Signed-off-by: William Wu --- drivers/usb/dwc3/host.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index d745e39e18da..fc42ff29c37a 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -46,7 +46,7 @@ out: int dwc3_host_init(struct dwc3 *dwc) { - struct property_entry props[7]; + struct property_entry props[8]; struct platform_device *xhci; int ret, irq; struct resource *res; @@ -119,6 +119,9 @@ int dwc3_host_init(struct dwc3 *dwc) if (dwc->xhci_warm_reset_on_suspend_quirk) props[prop_idx++].name = "xhci-warm-reset-on-suspend"; + if (!dwc->dis_u2_susphy_quirk) + props[prop_idx++].name = "xhci-u2-broken-suspend"; + if (prop_idx) { ret = platform_device_add_properties(xhci, props); if (ret) {