diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-25 06:23:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-25 06:23:15 -0400 |
commit | 1be025d3cb40cd295123af2c394f7229ef9b30ca (patch) | |
tree | 5dc14e1ea412cc7fdc3e563ad23187059fe8bfb5 /drivers/usb/usb-common.c | |
parent | 2d03423b2319cc854adeb28a03f65de5b5e0ab63 (diff) | |
parent | a2c76b83fdd763c826f38a55127ccf25708099ce (diff) |
Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (260 commits)
usb: renesas_usbhs: fixup inconsistent return from usbhs_pkt_push()
usb/isp1760: Allow to optionally trigger low-level chip reset via GPIOLIB.
USB: gadget: midi: memory leak in f_midi_bind_config()
USB: gadget: midi: fix range check in f_midi_out_open()
QE/FHCI: fixed the CONTROL bug
usb: renesas_usbhs: tidyup for smatch warnings
USB: Fix USB Kconfig dependency problem on 85xx/QoirQ platforms
EHCI: workaround for MosChip controller bug
usb: gadget: file_storage: fix race on unloading
USB: ftdi_sio.c: Use ftdi async_icount structure for TIOCMIWAIT, as in other drivers
USB: ftdi_sio.c:Fill MSR fields of the ftdi async_icount structure
USB: ftdi_sio.c: Fill LSR fields of the ftdi async_icount structure
USB: ftdi_sio.c:Fill TX field of the ftdi async_icount structure
USB: ftdi_sio.c: Fill the RX field of the ftdi async_icount structure
USB: ftdi_sio.c: Basic icount infrastructure for ftdi_sio
usb/isp1760: Let OF bindings depend on general CONFIG_OF instead of PPC_OF .
USB: ftdi_sio: Support TI/Luminary Micro Stellaris BD-ICDI Board
USB: Fix runtime wakeup on OHCI
xHCI/USB: Make xHCI driver have a BOS descriptor.
usb: gadget: add new usb gadget for ACM and mass storage
...
Diffstat (limited to 'drivers/usb/usb-common.c')
-rw-r--r-- | drivers/usb/usb-common.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/usb/usb-common.c b/drivers/usb/usb-common.c new file mode 100644 index 000000000000..d29503e954ab --- /dev/null +++ b/drivers/usb/usb-common.c | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * Provides code common for host and device side USB. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License as | ||
6 | * published by the Free Software Foundation, version 2. | ||
7 | * | ||
8 | * If either host side (ie. CONFIG_USB=y) or device side USB stack | ||
9 | * (ie. CONFIG_USB_GADGET=y) is compiled in the kernel, this module is | ||
10 | * compiled-in as well. Otherwise, if either of the two stacks is | ||
11 | * compiled as module, this file is compiled as module as well. | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/usb/ch9.h> | ||
17 | |||
18 | const char *usb_speed_string(enum usb_device_speed speed) | ||
19 | { | ||
20 | static const char *const names[] = { | ||
21 | [USB_SPEED_UNKNOWN] = "UNKNOWN", | ||
22 | [USB_SPEED_LOW] = "low-speed", | ||
23 | [USB_SPEED_FULL] = "full-speed", | ||
24 | [USB_SPEED_HIGH] = "high-speed", | ||
25 | [USB_SPEED_WIRELESS] = "wireless", | ||
26 | [USB_SPEED_SUPER] = "super-speed", | ||
27 | }; | ||
28 | |||
29 | if (speed < 0 || speed >= ARRAY_SIZE(names)) | ||
30 | speed = USB_SPEED_UNKNOWN; | ||
31 | return names[speed]; | ||
32 | } | ||
33 | EXPORT_SYMBOL_GPL(usb_speed_string); | ||
34 | |||
35 | MODULE_LICENSE("GPL"); | ||