[lkml]   [2019]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH AUTOSEL 4.19 155/192] usb: dwc3: gadget: Fix OTG events when gadget driver isn't loaded
From: Roger Quadros <>

[ Upstream commit 169e3b68cadb5775daca009ced4faf01ffd97dcf ]

On v3.10a in dual-role mode, if port is in device mode
and gadget driver isn't loaded, the OTG event interrupts don't
come through.

It seems that if the core is configured to be OTG2.0 only,
then we can't leave the DCFG.DEVSPD at Super-speed (default)
if we expect OTG to work properly. It must be set to High-speed.

Fix this issue by configuring DCFG.DEVSPD to the supported
maximum speed at gadget init. Device tree still needs to provide
correct supported maximum speed for this to work.

This issue wasn't present on v2.40a but is seen on v3.10a.
It doesn't cause any side effects on v2.40a.

Signed-off-by: Roger Quadros <>
Signed-off-by: Sekhar Nori <>
Signed-off-by: Felipe Balbi <>
Signed-off-by: Sasha Levin <>
drivers/usb/dwc3/gadget.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 700fb626ad03..524104eed8a7 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -3233,6 +3233,8 @@ int dwc3_gadget_init(struct dwc3 *dwc)
goto err4;

+ dwc3_gadget_set_speed(&dwc->gadget, dwc->maximum_speed);
return 0;

 \ /
  Last update: 2019-03-27 20:00    [W:0.424 / U:5.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site