aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2006-01-25 11:45:59 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-20 17:49:56 -0500
commit1c05ad4447e4ecbd61647c102fb6f2f5a6634ff3 (patch)
tree57e519afbd37b545a1e0cd9019d49ab38980f7b4
parent7802ac5c29d135345db1b06f9167075cd9f2d675 (diff)
[PATCH] recognize three more usb peripheral controllers
This adds declarations for three USB peripheral controllers: - Two high speed USB cores that can be licensed from Mentor Graphics to be integrated into silicon: * "musbhsfc" is for peripherals only, as found in for example the IBM/AMCC 44EP processors. * "musbhdrc" is OTG-capable (dual role), and is found in various products including OMAP 2430 and the new DaVinci SOCs. The "musbh" standing for "Mentor USB Highspeed", the rest standing for "Function Controller" or "Dual Role Controller" (OTG-capable). - The full speed controller on the FreeScale MPC8272. Adding these definitions just allows gadget driver code to handle any controller-specific logic; controller drivers are quite separate. Signed-off-by: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/gadget/ether.c8
-rw-r--r--drivers/usb/gadget/gadget_chips.h30
2 files changed, 36 insertions, 2 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 04b9743c1c1f..3d2603e31808 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -253,6 +253,14 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
253#define DEV_CONFIG_CDC 253#define DEV_CONFIG_CDC
254#endif 254#endif
255 255
256#ifdef CONFIG_USB_GADGET_MUSBHSFC
257#define DEV_CONFIG_CDC
258#endif
259
260#ifdef CONFIG_USB_GADGET_MUSBHDRC
261#define DEV_CONFIG_CDC
262#endif
263
256 264
257/* For CDC-incapable hardware, choose the simple cdc subset. 265/* For CDC-incapable hardware, choose the simple cdc subset.
258 * Anything that talks bulk (without notable bugs) can do this. 266 * Anything that talks bulk (without notable bugs) can do this.
diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
index 8cbae21d84b9..c4081407171f 100644
--- a/drivers/usb/gadget/gadget_chips.h
+++ b/drivers/usb/gadget/gadget_chips.h
@@ -3,9 +3,9 @@
3 * gadget drivers or other code that needs to deal with them, and which 3 * gadget drivers or other code that needs to deal with them, and which
4 * autoconfigures instead of using early binding to the hardware. 4 * autoconfigures instead of using early binding to the hardware.
5 * 5 *
6 * This could eventually work like the ARM mach_is_*() stuff, driven by 6 * This SHOULD eventually work like the ARM mach_is_*() stuff, driven by
7 * some config file that gets updated as new hardware is supported. 7 * some config file that gets updated as new hardware is supported.
8 * (And avoiding the runtime comparisons in typical one-choice cases.) 8 * (And avoiding all runtime comparisons in typical one-choice configs!)
9 * 9 *
10 * NOTE: some of these controller drivers may not be available yet. 10 * NOTE: some of these controller drivers may not be available yet.
11 */ 11 */
@@ -93,6 +93,26 @@
93#define gadget_is_imx(g) 0 93#define gadget_is_imx(g) 0
94#endif 94#endif
95 95
96/* Mentor high speed function controller */
97#ifdef CONFIG_USB_GADGET_MUSBHSFC
98#define gadget_is_musbhsfc(g) !strcmp("musbhsfc_udc", (g)->name)
99#else
100#define gadget_is_musbhsfc(g) 0
101#endif
102
103/* Mentor high speed "dual role" controller, peripheral mode */
104#ifdef CONFIG_USB_GADGET_MUSBHDRC
105#define gadget_is_musbhdrc(g) !strcmp("musbhdrc_udc", (g)->name)
106#else
107#define gadget_is_musbhdrc(g) 0
108#endif
109
110#ifdef CONFIG_USB_GADGET_MPC8272
111#define gadget_is_mpc8272(g) !strcmp("mpc8272_udc", (g)->name)
112#else
113#define gadget_is_mpc8272(g) 0
114#endif
115
96// CONFIG_USB_GADGET_SX2 116// CONFIG_USB_GADGET_SX2
97// CONFIG_USB_GADGET_AU1X00 117// CONFIG_USB_GADGET_AU1X00
98// ... 118// ...
@@ -143,5 +163,11 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
143 return 0x13; 163 return 0x13;
144 else if (gadget_is_imx(gadget)) 164 else if (gadget_is_imx(gadget))
145 return 0x14; 165 return 0x14;
166 else if (gadget_is_musbhsfc(gadget))
167 return 0x15;
168 else if (gadget_is_musbhdrc(gadget))
169 return 0x16;
170 else if (gadget_is_mpc8272(gadget))
171 return 0x17;
146 return -ENOENT; 172 return -ENOENT;
147} 173}