The "enumspd" field is located in register DSTS[2:1], but the current
set of macros define the possible values without the necessary offset.
This in turn causes incorrect detection of gadget link partner speed
in dwc2_hsotg_irq_enumdone() .

The rest of the macros in dwc2/hw.h always define possible values of
fields with offset, so keep this consistent, add the necessary offset
and fix the problem with speed detection.

Signed-off-by: Marek Vasut <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: John Youn <[email protected]>
---
 drivers/usb/dwc2/hw.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/dwc2/hw.h b/drivers/usb/dwc2/hw.h
index 553f246..0fd5683 100644
--- a/drivers/usb/dwc2/hw.h
+++ b/drivers/usb/dwc2/hw.h
@@ -452,10 +452,10 @@
 #define DSTS_ERRATICERR                        (1 << 3)
 #define DSTS_ENUMSPD_MASK              (0x3 << 1)
 #define DSTS_ENUMSPD_SHIFT             1
-#define DSTS_ENUMSPD_HS                        0
-#define DSTS_ENUMSPD_FS                        1
-#define DSTS_ENUMSPD_LS                        2
-#define DSTS_ENUMSPD_FS48              3
+#define DSTS_ENUMSPD_HS                        (0 << 1)
+#define DSTS_ENUMSPD_FS                        (1 << 1)
+#define DSTS_ENUMSPD_LS                        (2 << 1)
+#define DSTS_ENUMSPD_FS48              (3 << 1)
 #define DSTS_SUSPSTS                   (1 << 0)
 
 #define DIEPMSK                                HSOTG_REG(0x810)
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to