diff options
Diffstat (limited to 'drivers/usb/common/common.c')
-rw-r--r-- | drivers/usb/common/common.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c index 73c8e6591746..18f5dcf58b0d 100644 --- a/drivers/usb/common/common.c +++ b/drivers/usb/common/common.c | |||
@@ -16,6 +16,22 @@ | |||
16 | #include <linux/usb/otg.h> | 16 | #include <linux/usb/otg.h> |
17 | #include <linux/of_platform.h> | 17 | #include <linux/of_platform.h> |
18 | 18 | ||
19 | static const char *const ep_type_names[] = { | ||
20 | [USB_ENDPOINT_XFER_CONTROL] = "ctrl", | ||
21 | [USB_ENDPOINT_XFER_ISOC] = "isoc", | ||
22 | [USB_ENDPOINT_XFER_BULK] = "bulk", | ||
23 | [USB_ENDPOINT_XFER_INT] = "intr", | ||
24 | }; | ||
25 | |||
26 | const char *usb_ep_type_string(int ep_type) | ||
27 | { | ||
28 | if (ep_type < 0 || ep_type >= ARRAY_SIZE(ep_type_names)) | ||
29 | return "unknown"; | ||
30 | |||
31 | return ep_type_names[ep_type]; | ||
32 | } | ||
33 | EXPORT_SYMBOL_GPL(usb_ep_type_string); | ||
34 | |||
19 | const char *usb_otg_state_string(enum usb_otg_state state) | 35 | const char *usb_otg_state_string(enum usb_otg_state state) |
20 | { | 36 | { |
21 | static const char *const names[] = { | 37 | static const char *const names[] = { |