usb: core: sysfs: Check for SSP rate in speed attr
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 11 Mar 2021 03:43:07 +0000 (19:43 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Mar 2021 12:18:22 +0000 (13:18 +0100)
Check for usb_device->ssp_rate to output the signaling rate for genXxY.

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/80a3214592b30da6ca95bb87984f2a9779de0b14.1615432770.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/sysfs.c

index d85699bee671f791bd95c2f95abc2881914419b4..5a168ba9fc518f0b51c1a111854fe4576dd6e585 100644 (file)
@@ -167,7 +167,10 @@ static ssize_t speed_show(struct device *dev, struct device_attribute *attr,
                speed = "5000";
                break;
        case USB_SPEED_SUPER_PLUS:
-               speed = "10000";
+               if (udev->ssp_rate == USB_SSP_GEN_2x2)
+                       speed = "20000";
+               else
+                       speed = "10000";
                break;
        default:
                speed = "unknown";