summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-07-08 15:07:11 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-07-22 08:08:44 +0200
commit2776d53d7ac8c2833d5220e7d96a2256642f6e7a (patch)
tree784694f14193fcbb30ede9558f578c0b9b3d089d /drivers/usb/core
parent5ec16bea1a5425f944e6b909edda538385b238ca (diff)
downloadbarebox-2776d53d7ac8c2833d5220e7d96a2256642f6e7a.tar.gz
barebox-2776d53d7ac8c2833d5220e7d96a2256642f6e7a.tar.xz
USB: gadget: Update to 3.15
This updates the USB Gadget stack to Linux-3.15. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Conflicts: drivers/usb/core/Makefile
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/Makefile1
-rw-r--r--drivers/usb/core/common.c19
-rw-r--r--drivers/usb/core/usb.c1
3 files changed, 21 insertions, 0 deletions
diff --git a/drivers/usb/core/Makefile b/drivers/usb/core/Makefile
index a74f141db4..8002c63e50 100644
--- a/drivers/usb/core/Makefile
+++ b/drivers/usb/core/Makefile
@@ -1,3 +1,4 @@
obj-$(CONFIG_USB_HOST) += usb.o
+obj-$(CONFIG_USB) += common.o
obj-$(CONFIG_OFDEVICE) += of.o
diff --git a/drivers/usb/core/common.c b/drivers/usb/core/common.c
new file mode 100644
index 0000000000..690d5a39ea
--- /dev/null
+++ b/drivers/usb/core/common.c
@@ -0,0 +1,19 @@
+#include <common.h>
+#include <usb/ch9.h>
+
+static const char *const speed_names[] = {
+ [USB_SPEED_UNKNOWN] = "UNKNOWN",
+ [USB_SPEED_LOW] = "low-speed",
+ [USB_SPEED_FULL] = "full-speed",
+ [USB_SPEED_HIGH] = "high-speed",
+ [USB_SPEED_WIRELESS] = "wireless",
+ [USB_SPEED_SUPER] = "super-speed",
+};
+
+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];
+}
+EXPORT_SYMBOL_GPL(usb_speed_string);
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index f5724322ce..dea5f6e046 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -51,6 +51,7 @@
#include <dma.h>
#include <usb/usb.h>
+#include <usb/ch9.h>
/* #define USB_DEBUG */