All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] usb: dwc2: awake rt305x USB controller
@ 2018-07-20 12:05 John Crispin
  0 siblings, 0 replies; only message in thread
From: John Crispin @ 2018-07-20 12:05 UTC (permalink / raw)
  To: Minas Harutyunyan, Greg Kroah-Hartman
  Cc: linux-usb, Serge Vasilugin, John Crispin

From: Serge Vasilugin <vasilugin@yandex.ru>

The Ralink uboot sets the USB controller into sleep mode. This patch checks
this condition and awakes controller before any register access.

Signed-off-by: Serge Vasilugin <vasilugin@yandex.ru>
Signed-off-by: John Crispin <john@phrozen.org>
---
Hi,
we have been carrying this patch inside OpenWrt for half a decade. The
USB driver that is included in the Ralink SDK does a mdelay(25) after
this call but it works without apparently.
	John

 drivers/usb/dwc2/platform.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 4c0819554bcd..0bc9fd65e29e 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -419,6 +419,10 @@ static int dwc2_driver_probe(struct platform_device *dev)
 	if (retval)
 		return retval;
 
+	/* Enable USB port before any regs access */
+	if (dwc2_readl(hsotg->regs + PCGCTL) & 0x0f)
+		dwc2_writel(0x00, hsotg->regs + PCGCTL);
+
 	retval = dwc2_get_dr_mode(hsotg);
 	if (retval)
 		goto error;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-07-20 12:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-20 12:05 [PATCH/RFC] usb: dwc2: awake rt305x USB controller John Crispin

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.