All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RFC] usb: dwc2: Run the core connect in dwc2_hcd_init()
@ 2020-04-13 14:31 Marek Vasut
  2020-04-13 14:45 ` Minas Harutyunyan
  0 siblings, 1 reply; 21+ messages in thread
From: Marek Vasut @ 2020-04-13 14:31 UTC (permalink / raw)
  To: linux-usb
  Cc: Marek Vasut, Amelie Delaunay, Greg Kroah-Hartman,
	Manivannan Sadhasivam, Minas Harutyunyan

On STM32MP1 without the STUSB1600 USB-C chip (i.e. with plain USB-OTG
micro-B plug with ID and VBUS detection), the USB OTG port only works
if a micro-B device (e.g. a USB stick) is plugged in first. Once this
is done, both micro-B device and host (e.g. a PC via a USB A-to-microB
cable) are correctly detected and recognized. If a USB host is plugged
in first (e.g. a PC), then the PC does not detect the STM32MP1 at all.

By running the core connect code in dwc2_hcd_init(), both device and
host are detected and the USB works as expected. However, it is not
clear whether this is the correct solution.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Amelie Delaunay <amelie.delaunay@st.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Minas Harutyunyan <hminas@synopsys.com>
To: linux-usb@vger.kernel.org
---
 drivers/usb/dwc2/hcd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index b90f858af960..ead605efeb24 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -5237,6 +5237,11 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg)
 
 	dwc2_enable_global_interrupts(hsotg);
 
+	dwc2_hsotg_core_init_disconnected(hsotg, false);
+	/* Enable ACG feature in device mode,if supported */
+	dwc2_enable_acg(hsotg);
+	dwc2_hsotg_core_connect(hsotg);
+
 	return 0;
 
 error4:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-05-28 22:35 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 14:31 [PATCH] [RFC] usb: dwc2: Run the core connect in dwc2_hcd_init() Marek Vasut
2020-04-13 14:45 ` Minas Harutyunyan
2020-04-13 14:54   ` Marek Vasut
2020-04-13 15:27     ` Minas Harutyunyan
2020-04-13 17:00       ` Marek Vasut
2020-04-14  7:14         ` Minas Harutyunyan
2020-04-14 12:18           ` Marek Vasut
2020-04-15  8:37             ` Minas Harutyunyan
2020-04-15 14:55               ` Marek Vasut
2020-04-15 15:10                 ` Minas Harutyunyan
2020-04-16  9:46                   ` Marek Vasut
2020-04-16 13:37                     ` Minas Harutyunyan
2020-04-16 14:31                       ` Marek Vasut
2020-04-17  9:00                         ` Minas Harutyunyan
2020-04-20 12:09                           ` Marek Vasut
2020-04-22 13:45                             ` Minas Harutyunyan
2020-04-22 14:21                               ` Marek Vasut
2020-05-14  0:10                                 ` Marek Vasut
2020-05-15  7:41                                   ` Minas Harutyunyan
2020-05-27  6:17                                     ` Minas Harutyunyan
2020-05-28 22:35                                       ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.