aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-05-24 03:27:56 -0400
committerFelipe Balbi <balbi@ti.com>2012-06-03 16:08:25 -0400
commitfcc023c726b5879d8f3f0f0f48c45d09055272c4 (patch)
treeb5a88957b7fdc046305c98eb034e6f0d25780c22 /drivers/usb/dwc3/gadget.c
parent7acd85e0eb2ed300edf123178445237059b35fb9 (diff)
usb: dwc3: gadget: prevent DCTL register corruption
If we don't read out the contents of the register (in order to reinitialize 'reg' variable) we will be writing unknown contents to the DCTL register whenever we try to use dwc3_gadget_wakeup() function. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 04048333ec1a..867c476853ec 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1307,6 +1307,7 @@ static int dwc3_gadget_wakeup(struct usb_gadget *g)
1307 /* Recent versions do this automatically */ 1307 /* Recent versions do this automatically */
1308 if (dwc->revision < DWC3_REVISION_194A) { 1308 if (dwc->revision < DWC3_REVISION_194A) {
1309 /* write zeroes to Link Change Request */ 1309 /* write zeroes to Link Change Request */
1310 reg = dwc3_readl(dwc->regs, DWC3_DCTL);
1310 reg &= ~DWC3_DCTL_ULSTCHNGREQ_MASK; 1311 reg &= ~DWC3_DCTL_ULSTCHNGREQ_MASK;
1311 dwc3_writel(dwc->regs, DWC3_DCTL, reg); 1312 dwc3_writel(dwc->regs, DWC3_DCTL, reg);
1312 } 1313 }