summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2015-12-18 03:26:17 +0100
committerFelipe Balbi <balbi@ti.com>2015-12-22 12:03:05 -0600
commit6d76c92c2fcbee4fd1f6d7b375d71057c7a615b1 (patch)
treeafefb3ec8f2cb6417fc63dbadb5c59a4399e1b7d /drivers/usb/dwc2
parent60c0288c72c980fb37ed4e48f68c9743a53b662c (diff)
downloadop-kernel-dev-6d76c92c2fcbee4fd1f6d7b375d71057c7a615b1.zip
op-kernel-dev-6d76c92c2fcbee4fd1f6d7b375d71057c7a615b1.tar.gz
usb: dwc2: gadget: Repair DSTS register decoding
The "enumspd" field is located in register DSTS[2:1], but the code which checks the bitfield does not shift the value accordingly. This in turn causes incorrect detection of gadget link partner speed in dwc2_hsotg_irq_enumdone() . Shift the value accordingly to fix the problem with speed detection. Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Felipe Balbi <balbi@ti.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc2')
-rw-r--r--drivers/usb/dwc2/gadget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 8ab7a9e..422ab7d 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2095,7 +2095,7 @@ static void dwc2_hsotg_irq_enumdone(struct dwc2_hsotg *hsotg)
*/
/* catch both EnumSpd_FS and EnumSpd_FS48 */
- switch (dsts & DSTS_ENUMSPD_MASK) {
+ switch ((dsts & DSTS_ENUMSPD_MASK) >> DSTS_ENUMSPD_SHIFT) {
case DSTS_ENUMSPD_FS:
case DSTS_ENUMSPD_FS48:
hsotg->gadget.speed = USB_SPEED_FULL;
OpenPOWER on IntegriCloud