diff options
author | Stephen Warren <swarren@wwwdotorg.org> | 2015-03-28 03:55:38 (GMT) |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2015-04-14 03:47:59 (GMT) |
commit | 4748cce57345a23dbbc990a28ca9d97952432c4f (patch) | |
tree | c889d66d476e5e9e78bd03405fb10f85175e3474 /drivers | |
parent | 5c0beb5c58c86d2a6d12dee6330dc85554de5c60 (diff) | |
download | u-boot-fsl-qoriq-4748cce57345a23dbbc990a28ca9d97952432c4f.tar.xz |
usb: dwc2: detect device speed correctly
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/dwc2.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/dwc2.h | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c index 8f7c269..b506ff2 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 ba08fd5..45408c6 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) |