usb: cdnsp: Fix issue with detecting USB 3.2 speed
commit 2852788cfbe9ca1ab68509d65804413871f741f9 upstream.
Patch adds support for detecting SuperSpeedPlus Gen1 x2 and
SuperSpeedPlus Gen2 x2 speed.
Fixes: 3d82904559
("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
81dc3db4c3
commit
c40b5e0aad
@@ -28,7 +28,8 @@
|
||||
unsigned int cdnsp_port_speed(unsigned int port_status)
|
||||
{
|
||||
/*Detect gadget speed based on PORTSC register*/
|
||||
if (DEV_SUPERSPEEDPLUS(port_status))
|
||||
if (DEV_SUPERSPEEDPLUS(port_status) ||
|
||||
DEV_SSP_GEN1x2(port_status) || DEV_SSP_GEN2x2(port_status))
|
||||
return USB_SPEED_SUPER_PLUS;
|
||||
else if (DEV_SUPERSPEED(port_status))
|
||||
return USB_SPEED_SUPER;
|
||||
|
@@ -285,11 +285,15 @@ struct cdnsp_port_regs {
|
||||
#define XDEV_HS (0x3 << 10)
|
||||
#define XDEV_SS (0x4 << 10)
|
||||
#define XDEV_SSP (0x5 << 10)
|
||||
#define XDEV_SSP1x2 (0x6 << 10)
|
||||
#define XDEV_SSP2x2 (0x7 << 10)
|
||||
#define DEV_UNDEFSPEED(p) (((p) & DEV_SPEED_MASK) == (0x0 << 10))
|
||||
#define DEV_FULLSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_FS)
|
||||
#define DEV_HIGHSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_HS)
|
||||
#define DEV_SUPERSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_SS)
|
||||
#define DEV_SUPERSPEEDPLUS(p) (((p) & DEV_SPEED_MASK) == XDEV_SSP)
|
||||
#define DEV_SSP_GEN1x2(p) (((p) & DEV_SPEED_MASK) == XDEV_SSP1x2)
|
||||
#define DEV_SSP_GEN2x2(p) (((p) & DEV_SPEED_MASK) == XDEV_SSP2x2)
|
||||
#define DEV_SUPERSPEED_ANY(p) (((p) & DEV_SPEED_MASK) >= XDEV_SS)
|
||||
#define DEV_PORT_SPEED(p) (((p) >> 10) & 0x0f)
|
||||
/* Port Link State Write Strobe - set this when changing link state */
|
||||
|
Reference in New Issue
Block a user