diff mbox series

[3/4] usb: dwc3: gadget: Clear DCTL.ULSTCHNGREQ before set

Message ID 90732ce7d362021ba0e8709c8b9c9e2eb02b83c2.1571770732.git.thinhn@synopsys.com (mailing list archive)
State Superseded
Headers show
Series usb: gadget: Link state changes | expand

Commit Message

Thinh Nguyen Oct. 22, 2019, 7:10 p.m. UTC
Send a no-action link state change request before the actual request
so DWC3 can send the same request whenever we call
dwc3_gadget_set_link_state().

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
---
 drivers/usb/dwc3/gadget.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 37631d2e2a2e..03d58254d1e6 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -113,6 +113,9 @@  int dwc3_gadget_set_link_state(struct dwc3 *dwc, enum dwc3_link_state state)
 	reg = dwc3_readl(dwc->regs, DWC3_DCTL);
 	reg &= ~DWC3_DCTL_ULSTCHNGREQ_MASK;
 
+	/* set no action before sending new link state change */
+	dwc3_writel(dwc->regs, DWC3_DCTL, reg);
+
 	/* set requested state */
 	reg |= DWC3_DCTL_ULSTCHNGREQ(state);
 	dwc3_writel(dwc->regs, DWC3_DCTL, reg);