public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] usb: dwc2: detect device speed correctly
@ 2015-03-28  3:55 Stephen Warren
  2015-04-02 17:04 ` Marek Vasut
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2015-03-28  3:55 UTC (permalink / raw)
  To: u-boot

This doesn't make my LS keyboard work any better, but it does at least
report the correct speed in "usb tree".

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 drivers/usb/host/dwc2.c | 6 +++++-
 drivers/usb/host/dwc2.h | 3 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index 8f7c269dd1a5..b506ff23ed38 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -463,7 +463,11 @@ static int dwc_otg_submit_rh_msg_in_status(struct usb_device *dev, void *buffer,
 		if (hprt0 & DWC2_HPRT0_PRTPWR)
 			port_status |= USB_PORT_STAT_POWER;
 
-		port_status |= USB_PORT_STAT_HIGH_SPEED;
+		if ((hprt0 & DWC2_HPRT0_PRTSPD_MASK) == DWC2_HPRT0_PRTSPD_LOW)
+			port_status |= USB_PORT_STAT_LOW_SPEED;
+		else if ((hprt0 & DWC2_HPRT0_PRTSPD_MASK) ==
+			 DWC2_HPRT0_PRTSPD_HIGH)
+			port_status |= USB_PORT_STAT_HIGH_SPEED;
 
 		if (hprt0 & DWC2_HPRT0_PRTENCHNG)
 			port_change |= USB_PORT_STAT_C_ENABLE;
diff --git a/drivers/usb/host/dwc2.h b/drivers/usb/host/dwc2.h
index ba08fd554f17..45408c6f5cc1 100644
--- a/drivers/usb/host/dwc2.h
+++ b/drivers/usb/host/dwc2.h
@@ -536,6 +536,9 @@ struct dwc2_core_regs {
 #define DWC2_HPRT0_PRTPWR_OFFSET			12
 #define DWC2_HPRT0_PRTTSTCTL_MASK			(0xF << 13)
 #define DWC2_HPRT0_PRTTSTCTL_OFFSET			13
+#define DWC2_HPRT0_PRTSPD_HIGH				(0 << 17)
+#define DWC2_HPRT0_PRTSPD_FULL				(1 << 17)
+#define DWC2_HPRT0_PRTSPD_LOW				(2 << 17)
 #define DWC2_HPRT0_PRTSPD_MASK				(0x3 << 17)
 #define DWC2_HPRT0_PRTSPD_OFFSET			17
 #define DWC2_HAINT_CH0					(1 << 0)
-- 
1.9.1

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

* [U-Boot] [PATCH] usb: dwc2: detect device speed correctly
  2015-03-28  3:55 [U-Boot] [PATCH] usb: dwc2: detect device speed correctly Stephen Warren
@ 2015-04-02 17:04 ` Marek Vasut
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2015-04-02 17:04 UTC (permalink / raw)
  To: u-boot

On Saturday, March 28, 2015 at 04:55:38 AM, Stephen Warren wrote:
> This doesn't make my LS keyboard work any better, but it does at least
> report the correct speed in "usb tree".
> 
> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>

Applied to topic/dwc2 , thanks! This will go into next release.

Best regards,
Marek Vasut

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

end of thread, other threads:[~2015-04-02 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-28  3:55 [U-Boot] [PATCH] usb: dwc2: detect device speed correctly Stephen Warren
2015-04-02 17:04 ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox