aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-03-07 03:45:56 -0500
committerFelipe Balbi <balbi@ti.com>2013-03-18 05:18:03 -0400
commit7009bdd7f31ed6e769af0f76e2368bb6033be572 (patch)
tree77937b38a3e34edce74c966695849bf528575271 /drivers/usb
parent42c0bf1ce7c067bbc3e77d5626f102a16bc4fb6b (diff)
usb: otg: move usb_otg_state_string to usb-common.c
otg.c only had a single function definition which might make more sense to be placed in usb-common.c. While doing that, we also delete otg.c since it's now empty. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/otg/Makefile3
-rw-r--r--drivers/usb/otg/otg.c47
-rw-r--r--drivers/usb/usb-common.c26
3 files changed, 26 insertions, 50 deletions
diff --git a/drivers/usb/otg/Makefile b/drivers/usb/otg/Makefile
index a844b8d35d14..6abc45388e24 100644
--- a/drivers/usb/otg/Makefile
+++ b/drivers/usb/otg/Makefile
@@ -5,9 +5,6 @@
5ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG 5ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
6ccflags-$(CONFIG_USB_GADGET_DEBUG) += -DDEBUG 6ccflags-$(CONFIG_USB_GADGET_DEBUG) += -DDEBUG
7 7
8# infrastructure
9obj-$(CONFIG_USB_OTG_UTILS) += otg.o
10
11# transceiver drivers 8# transceiver drivers
12obj-$(CONFIG_USB_GPIO_VBUS) += gpio_vbus.o 9obj-$(CONFIG_USB_GPIO_VBUS) += gpio_vbus.o
13obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o 10obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o
diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c
deleted file mode 100644
index fd9a4b7bebe7..000000000000
--- a/drivers/usb/otg/otg.c
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * otg.c -- USB OTG utility code
3 *
4 * Copyright (C) 2004 Texas Instruments
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11#include <linux/export.h>
12#include <linux/usb/otg.h>
13
14const char *usb_otg_state_string(enum usb_otg_state state)
15{
16 switch (state) {
17 case OTG_STATE_A_IDLE:
18 return "a_idle";
19 case OTG_STATE_A_WAIT_VRISE:
20 return "a_wait_vrise";
21 case OTG_STATE_A_WAIT_BCON:
22 return "a_wait_bcon";
23 case OTG_STATE_A_HOST:
24 return "a_host";
25 case OTG_STATE_A_SUSPEND:
26 return "a_suspend";
27 case OTG_STATE_A_PERIPHERAL:
28 return "a_peripheral";
29 case OTG_STATE_A_WAIT_VFALL:
30 return "a_wait_vfall";
31 case OTG_STATE_A_VBUS_ERR:
32 return "a_vbus_err";
33 case OTG_STATE_B_IDLE:
34 return "b_idle";
35 case OTG_STATE_B_SRP_INIT:
36 return "b_srp_init";
37 case OTG_STATE_B_PERIPHERAL:
38 return "b_peripheral";
39 case OTG_STATE_B_WAIT_ACON:
40 return "b_wait_acon";
41 case OTG_STATE_B_HOST:
42 return "b_host";
43 default:
44 return "UNDEFINED";
45 }
46}
47EXPORT_SYMBOL(usb_otg_state_string);
diff --git a/drivers/usb/usb-common.c b/drivers/usb/usb-common.c
index 070b681e5d17..0db0a919d72b 100644
--- a/drivers/usb/usb-common.c
+++ b/drivers/usb/usb-common.c
@@ -14,6 +14,32 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/usb/ch9.h> 16#include <linux/usb/ch9.h>
17#include <linux/usb/otg.h>
18
19const char *usb_otg_state_string(enum usb_otg_state state)
20{
21 static const char *const names[] = {
22 [OTG_STATE_A_IDLE] = "a_idle",
23 [OTG_STATE_A_WAIT_VRISE] = "a_wait_vrise",
24 [OTG_STATE_A_WAIT_BCON] = "a_wait_bcon",
25 [OTG_STATE_A_HOST] = "a_host",
26 [OTG_STATE_A_SUSPEND] = "a_suspend",
27 [OTG_STATE_A_PERIPHERAL] = "a_peripheral",
28 [OTG_STATE_A_WAIT_VFALL] = "a_wait_vfall",
29 [OTG_STATE_A_VBUS_ERR] = "a_vbus_err",
30 [OTG_STATE_B_IDLE] = "b_idle",
31 [OTG_STATE_B_SRP_INIT] = "b_srp_init",
32 [OTG_STATE_B_PERIPHERAL] = "b_peripheral",
33 [OTG_STATE_B_WAIT_ACON] = "b_wait_acon",
34 [OTG_STATE_B_HOST] = "b_host",
35 };
36
37 if (state < 0 || state >= ARRAY_SIZE(names))
38 return "UNDEFINED";
39
40 return names[state];
41}
42EXPORT_SYMBOL_GPL(usb_otg_state_string);
17 43
18const char *usb_speed_string(enum usb_device_speed speed) 44const char *usb_speed_string(enum usb_device_speed speed)
19{ 45{