Commit a5423add authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB Gadget: add and use gadget_is_pxa27x()

The UDC in Intel's "Bulverde" processors is incompatible with the
one in their PXA 25x/26x/21x processors, and has different sorts
of restrictions.  For example, it can implement real CDC Ethernet,
while the earlier (PXA 25x etc) can't.


This adds a gadget_is_pxa27x() function and uses it appropriately in the
current set of gadget drivers.  (And moves an LH7A40X entry to the right
place in "ether.c").

From: Dmitry Krivoschokov <dkrivoschokov@dev.rtsoft.ru>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 968832dd
...@@ -223,6 +223,10 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address"); ...@@ -223,6 +223,10 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
#define DEV_CONFIG_CDC #define DEV_CONFIG_CDC
#endif #endif
#ifdef CONFIG_USB_GADGET_LH7A40X
#define DEV_CONFIG_CDC
#endif
#ifdef CONFIG_USB_GADGET_MQ11XX #ifdef CONFIG_USB_GADGET_MQ11XX
#define DEV_CONFIG_CDC #define DEV_CONFIG_CDC
#endif #endif
...@@ -235,6 +239,10 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address"); ...@@ -235,6 +239,10 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
#define DEV_CONFIG_CDC #define DEV_CONFIG_CDC
#endif #endif
#ifdef CONFIG_USB_GADGET_PXA27X
#define DEV_CONFIG_CDC
#endif
/* For CDC-incapable hardware, choose the simple cdc subset. /* For CDC-incapable hardware, choose the simple cdc subset.
* Anything that talks bulk (without notable bugs) can do this. * Anything that talks bulk (without notable bugs) can do this.
...@@ -247,10 +255,6 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address"); ...@@ -247,10 +255,6 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
#define DEV_CONFIG_SUBSET #define DEV_CONFIG_SUBSET
#endif #endif
#ifdef CONFIG_USB_GADGET_LH7A40X
#define DEV_CONFIG_CDC
#endif
#ifdef CONFIG_USB_GADGET_SA1100 #ifdef CONFIG_USB_GADGET_SA1100
/* use non-CDC for backwards compatibility */ /* use non-CDC for backwards compatibility */
#define DEV_CONFIG_SUBSET #define DEV_CONFIG_SUBSET
...@@ -2321,6 +2325,8 @@ eth_bind (struct usb_gadget *gadget) ...@@ -2321,6 +2325,8 @@ eth_bind (struct usb_gadget *gadget)
device_desc.bcdDevice = __constant_cpu_to_le16 (0x0209); device_desc.bcdDevice = __constant_cpu_to_le16 (0x0209);
} else if (gadget_is_n9604(gadget)) { } else if (gadget_is_n9604(gadget)) {
device_desc.bcdDevice = __constant_cpu_to_le16 (0x0210); device_desc.bcdDevice = __constant_cpu_to_le16 (0x0210);
} else if (gadget_is_pxa27x(gadget)) {
device_desc.bcdDevice = __constant_cpu_to_le16 (0x0211);
} else { } else {
/* can't assume CDC works. don't want to default to /* can't assume CDC works. don't want to default to
* anything less functional on CDC-capable hardware, * anything less functional on CDC-capable hardware,
......
...@@ -3739,6 +3739,8 @@ static int __init check_parameters(struct fsg_dev *fsg) ...@@ -3739,6 +3739,8 @@ static int __init check_parameters(struct fsg_dev *fsg)
mod_data.release = 0x0309; mod_data.release = 0x0309;
else if (gadget_is_n9604(fsg->gadget)) else if (gadget_is_n9604(fsg->gadget))
mod_data.release = 0x0310; mod_data.release = 0x0310;
else if (gadget_is_pxa27x(fsg->gadget))
mod_data.release = 0x0311;
else { else {
WARN(fsg, "controller '%s' not recognized\n", WARN(fsg, "controller '%s' not recognized\n",
fsg->gadget->name); fsg->gadget->name);
......
...@@ -68,6 +68,12 @@ ...@@ -68,6 +68,12 @@
#define gadget_is_n9604(g) 0 #define gadget_is_n9604(g) 0
#endif #endif
#ifdef CONFIG_USB_GADGET_PXA27X
#define gadget_is_pxa27x(g) !strcmp("pxa27x_udc", (g)->name)
#else
#define gadget_is_pxa27x(g) 0
#endif
// CONFIG_USB_GADGET_AT91RM9200 // CONFIG_USB_GADGET_AT91RM9200
// CONFIG_USB_GADGET_SX2 // CONFIG_USB_GADGET_SX2
// CONFIG_USB_GADGET_AU1X00 // CONFIG_USB_GADGET_AU1X00
......
...@@ -1529,6 +1529,9 @@ static int gs_bind(struct usb_gadget *gadget) ...@@ -1529,6 +1529,9 @@ static int gs_bind(struct usb_gadget *gadget)
} else if (gadget_is_n9604(gadget)) { } else if (gadget_is_n9604(gadget)) {
gs_device_desc.bcdDevice = gs_device_desc.bcdDevice =
__constant_cpu_to_le16(GS_VERSION_NUM|0x0009); __constant_cpu_to_le16(GS_VERSION_NUM|0x0009);
} else if (gadget_is_pxa27x(gadget)) {
gs_device_desc.bcdDevice =
__constant_cpu_to_le16(GS_VERSION_NUM|0x0011);
} else { } else {
printk(KERN_WARNING "gs_bind: controller '%s' not recognized\n", printk(KERN_WARNING "gs_bind: controller '%s' not recognized\n",
gadget->name); gadget->name);
......
...@@ -1190,6 +1190,8 @@ zero_bind (struct usb_gadget *gadget) ...@@ -1190,6 +1190,8 @@ zero_bind (struct usb_gadget *gadget)
device_desc.bcdDevice = __constant_cpu_to_le16 (0x0209); device_desc.bcdDevice = __constant_cpu_to_le16 (0x0209);
} else if (gadget_is_n9604(gadget)) { } else if (gadget_is_n9604(gadget)) {
device_desc.bcdDevice = __constant_cpu_to_le16 (0x0210); device_desc.bcdDevice = __constant_cpu_to_le16 (0x0210);
} else if (gadget_is_pxa27x(gadget)) {
device_desc.bcdDevice = __constant_cpu_to_le16 (0x0211);
} else { } else {
/* gadget zero is so simple (for now, no altsettings) that /* gadget zero is so simple (for now, no altsettings) that
* it SHOULD NOT have problems with bulk-capable hardware. * it SHOULD NOT have problems with bulk-capable hardware.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment