From 1f2d39df3fd763184bb9815bcd44df49d6ffcfcc 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 Signed-off-by: Frank Wang --- 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 e195176580de..a66f16e8816e 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -44,7 +44,7 @@ out: int dwc3_host_init(struct dwc3 *dwc) { - struct property_entry props[4]; + struct property_entry props[5]; struct platform_device *xhci; int ret, irq; struct resource *res; @@ -107,6 +107,9 @@ int dwc3_host_init(struct dwc3 *dwc) if (DWC3_VER_IS_WITHIN(DWC3, ANY, 300A)) props[prop_idx++] = PROPERTY_ENTRY_BOOL("quirk-broken-port-ped"); + if (!dwc->dis_u2_susphy_quirk) + props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-u2-broken-suspend"); + if (prop_idx) { ret = platform_device_add_properties(xhci, props); if (ret) {