]>
Commit | Line | Data |
---|---|---|
04fd09d4 SL |
1 | From 7b945193f11b36e19dce34269e9b55ece283eaf6 Mon Sep 17 00:00:00 2001 |
2 | From: Roger Quadros <rogerq@ti.com> | |
3 | Date: Thu, 10 Jan 2019 17:04:28 +0200 | |
4 | Subject: usb: dwc3: gadget: Fix OTG events when gadget driver isn't loaded | |
5 | ||
6 | [ Upstream commit 169e3b68cadb5775daca009ced4faf01ffd97dcf ] | |
7 | ||
8 | On v3.10a in dual-role mode, if port is in device mode | |
9 | and gadget driver isn't loaded, the OTG event interrupts don't | |
10 | come through. | |
11 | ||
12 | It seems that if the core is configured to be OTG2.0 only, | |
13 | then we can't leave the DCFG.DEVSPD at Super-speed (default) | |
14 | if we expect OTG to work properly. It must be set to High-speed. | |
15 | ||
16 | Fix this issue by configuring DCFG.DEVSPD to the supported | |
17 | maximum speed at gadget init. Device tree still needs to provide | |
18 | correct supported maximum speed for this to work. | |
19 | ||
20 | This issue wasn't present on v2.40a but is seen on v3.10a. | |
21 | It doesn't cause any side effects on v2.40a. | |
22 | ||
23 | Signed-off-by: Roger Quadros <rogerq@ti.com> | |
24 | Signed-off-by: Sekhar Nori <nsekhar@ti.com> | |
25 | Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> | |
26 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
27 | --- | |
28 | drivers/usb/dwc3/gadget.c | 2 ++ | |
29 | 1 file changed, 2 insertions(+) | |
30 | ||
31 | diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c | |
32 | index 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 | -- | |
45 | 2.19.1 | |
46 |