From a4de6e380fd1078c3f06210a0be0f3f8a69062dc Mon Sep 17 00:00:00 2001 From: Chunfeng Yun Date: Wed, 14 Oct 2020 15:08:27 +0800 Subject: usb: add USB_SPEED_SUPER_PLUS Add enum USB_SPEED_SUPER_PLUS for USB3.1 Signed-off-by: Chunfeng Yun Reviewed-by: Bin Meng --- include/linux/usb/ch9.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 989a5fcbd96..7d225ee9cb1 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h @@ -956,6 +956,7 @@ enum usb_device_speed { USB_SPEED_HIGH, /* usb 2.0 */ USB_SPEED_WIRELESS, /* wireless (usb 2.5) */ USB_SPEED_SUPER, /* usb 3.0 */ + USB_SPEED_SUPER_PLUS, /* usb 3.1 */ }; #ifdef __KERNEL__ -- cgit v1.3.1 From d92e866f6008fdd6483735c6fd1ed95c8fdc87b1 Mon Sep 17 00:00:00 2001 From: Chunfeng Yun Date: Wed, 14 Oct 2020 15:08:28 +0800 Subject: usb: common: add define of usb_speed_string() There is only declaration of usb_speed_string(), but no definition, so add it to avoid build error when call it. Signed-off-by: Chunfeng Yun Reviewed-by: Bin Meng --- drivers/usb/common/common.c | 7 +++++++ include/linux/usb/ch9.h | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'include/linux') diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c index 76f5a9ce60f..5e5c3c3e3dc 100644 --- a/drivers/usb/common/common.c +++ b/drivers/usb/common/common.c @@ -49,6 +49,13 @@ static const char *const speed_names[] = { [USB_SPEED_SUPER_PLUS] = "super-speed-plus", }; +const char *usb_speed_string(enum usb_device_speed speed) +{ + if (speed < 0 || speed >= ARRAY_SIZE(speed_names)) + speed = USB_SPEED_UNKNOWN; + return speed_names[speed]; +} + enum usb_device_speed usb_get_maximum_speed(ofnode node) { const char *max_speed; diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 7d225ee9cb1..a8fa5d74490 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h @@ -959,8 +959,6 @@ enum usb_device_speed { USB_SPEED_SUPER_PLUS, /* usb 3.1 */ }; -#ifdef __KERNEL__ - /** * usb_speed_string() - Returns human readable-name of the speed. * @speed: The speed to return human-readable name for. If it's not @@ -969,8 +967,6 @@ enum usb_device_speed { */ extern const char *usb_speed_string(enum usb_device_speed speed); -#endif - enum usb_device_state { /* NOTATTACHED isn't in the USB spec, and this state acts * the same as ATTACHED ... but it's clearer this way. -- cgit v1.3.1