]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.111/usb-dwc3-gadget-fix-otg-events-when-gadget-driver-is.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.111 / usb-dwc3-gadget-fix-otg-events-when-gadget-driver-is.patch
CommitLineData
04fd09d4
SL
1From 7b945193f11b36e19dce34269e9b55ece283eaf6 Mon Sep 17 00:00:00 2001
2From: Roger Quadros <rogerq@ti.com>
3Date: Thu, 10 Jan 2019 17:04:28 +0200
4Subject: usb: dwc3: gadget: Fix OTG events when gadget driver isn't loaded
5
6[ Upstream commit 169e3b68cadb5775daca009ced4faf01ffd97dcf ]
7
8On v3.10a in dual-role mode, if port is in device mode
9and gadget driver isn't loaded, the OTG event interrupts don't
10come through.
11
12It seems that if the core is configured to be OTG2.0 only,
13then we can't leave the DCFG.DEVSPD at Super-speed (default)
14if we expect OTG to work properly. It must be set to High-speed.
15
16Fix this issue by configuring DCFG.DEVSPD to the supported
17maximum speed at gadget init. Device tree still needs to provide
18correct supported maximum speed for this to work.
19
20This issue wasn't present on v2.40a but is seen on v3.10a.
21It doesn't cause any side effects on v2.40a.
22
23Signed-off-by: Roger Quadros <rogerq@ti.com>
24Signed-off-by: Sekhar Nori <nsekhar@ti.com>
25Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
26Signed-off-by: Sasha Levin <sashal@kernel.org>
27---
28 drivers/usb/dwc3/gadget.c | 2 ++
29 1 file changed, 2 insertions(+)
30
31diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
32index 32dd0d3462da..1b99d44e52b9 100644
33--- a/drivers/usb/dwc3/gadget.c
34+++ b/drivers/usb/dwc3/gadget.c
35@@ -3286,6 +3286,8 @@ int dwc3_gadget_init(struct dwc3 *dwc)
36 goto err4;
37 }
38
39+ dwc3_gadget_set_speed(&dwc->gadget, dwc->maximum_speed);
40+
41 return 0;
42
43 err4:
44--
452.19.1
46