summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/core.c
diff options
context:
space:
mode:
authorRoger Quadros2018-03-16 15:44:27 +0100
committerFelipe Balbi2018-03-22 09:50:15 +0100
commit7d11c3ac66694097a1f409bc3559664c48390d73 (patch)
tree91e8aa088e43f6e4f99019646a61c4ccb7faed87 /drivers/usb/dwc3/core.c
parentusb: dwc3: Check controller type before setting speed (diff)
downloadkernel-qcow2-linux-7d11c3ac66694097a1f409bc3559664c48390d73.tar.gz
kernel-qcow2-linux-7d11c3ac66694097a1f409bc3559664c48390d73.tar.xz
kernel-qcow2-linux-7d11c3ac66694097a1f409bc3559664c48390d73.zip
usb: dwc3: core: Fix broken system suspend/resume on AM437x
On TI's AM437x, the DWC3 controller looses state after a system suspend/resume. We are re-initializing the controller but we miss restoring the PRTCAP register. This causes USB host to break on AM437x after a system suspend/resume. Fix this by restoring the PRTCAP register on system resume. Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3/core.c')
-rw-r--r--drivers/usb/dwc3/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 7c8d3bedf802..814c986fc7be 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1440,6 +1440,7 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
if (ret)
return ret;
+ dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE);
spin_lock_irqsave(&dwc->lock, flags);
dwc3_gadget_resume(dwc);
spin_unlock_irqrestore(&dwc->lock, flags);
@@ -1450,6 +1451,7 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
ret = dwc3_core_init(dwc);
if (ret)
return ret;
+ dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_HOST);
}
break;
case DWC3_GCTL_PRTCAP_OTG: