Skip to content

Commit 921b3c8

Browse files
pawellcdnsgregkh
authored andcommitted
usb: cdnsp: Fix issue with detecting USB 3.2 speed
commit 2852788 upstream. Patch adds support for detecting SuperSpeedPlus Gen1 x2 and SuperSpeedPlus Gen2 x2 speed. Fixes: 3d82904 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") Cc: stable <stable@kernel.org> Signed-off-by: Pawel Laszczak <pawell@cadence.com> Acked-by: Peter Chen <peter.chen@kernel.org> Link: https://lore.kernel.org/r/PH7PR07MB95387AD98EDCA695FECE52BADD96A@PH7PR07MB9538.namprd07.prod.outlook.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c786297 commit 921b3c8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/usb/cdns3/cdnsp-gadget.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
unsigned int cdnsp_port_speed(unsigned int port_status)
2929
{
3030
/*Detect gadget speed based on PORTSC register*/
31-
if (DEV_SUPERSPEEDPLUS(port_status))
31+
if (DEV_SUPERSPEEDPLUS(port_status) ||
32+
DEV_SSP_GEN1x2(port_status) || DEV_SSP_GEN2x2(port_status))
3233
return USB_SPEED_SUPER_PLUS;
3334
else if (DEV_SUPERSPEED(port_status))
3435
return USB_SPEED_SUPER;

drivers/usb/cdns3/cdnsp-gadget.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,15 @@ struct cdnsp_port_regs {
285285
#define XDEV_HS (0x3 << 10)
286286
#define XDEV_SS (0x4 << 10)
287287
#define XDEV_SSP (0x5 << 10)
288+
#define XDEV_SSP1x2 (0x6 << 10)
289+
#define XDEV_SSP2x2 (0x7 << 10)
288290
#define DEV_UNDEFSPEED(p) (((p) & DEV_SPEED_MASK) == (0x0 << 10))
289291
#define DEV_FULLSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_FS)
290292
#define DEV_HIGHSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_HS)
291293
#define DEV_SUPERSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_SS)
292294
#define DEV_SUPERSPEEDPLUS(p) (((p) & DEV_SPEED_MASK) == XDEV_SSP)
295+
#define DEV_SSP_GEN1x2(p) (((p) & DEV_SPEED_MASK) == XDEV_SSP1x2)
296+
#define DEV_SSP_GEN2x2(p) (((p) & DEV_SPEED_MASK) == XDEV_SSP2x2)
293297
#define DEV_SUPERSPEED_ANY(p) (((p) & DEV_SPEED_MASK) >= XDEV_SS)
294298
#define DEV_PORT_SPEED(p) (((p) >> 10) & 0x0f)
295299
/* Port Link State Write Strobe - set this when changing link state */

0 commit comments

Comments
 (0)