ChangeSet 1.1843.4.7, 2004/08/24 11:41:16-07:00, [EMAIL PROTECTED]
[PATCH] USB: gadget drivers learn about LH7A40x
Recognize the UDC for the Sharp LH7A40x chips (ARMv4t SOCs)
- define gadget_is_lh7a40x() macro
- gadget drivers use it to assign bcdDevice
- supports CDC Ethernet (and RNDIS)
From: Bo Henriksen
Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
drivers/usb/gadget/ether.c | 6 ++++++
drivers/usb/gadget/file_storage.c | 2 ++
drivers/usb/gadget/gadget_chips.h | 6 ++++++
drivers/usb/gadget/inode.c | 4 ++++
drivers/usb/gadget/serial.c | 3 +++
drivers/usb/gadget/zero.c | 2 ++
6 files changed, 23 insertions(+)
diff -Nru a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
--- a/drivers/usb/gadget/ether.c 2004-08-26 16:43:15 -07:00
+++ b/drivers/usb/gadget/ether.c 2004-08-26 16:43:15 -07:00
@@ -242,6 +242,10 @@
#define DEV_CONFIG_SUBSET
#endif
+#ifdef CONFIG_USB_GADGET_LH7A40X
+#define DEV_CONFIG_CDC
+#endif
+
#ifdef CONFIG_USB_GADGET_SA1100
/* use non-CDC for backwards compatibility */
#define DEV_CONFIG_SUBSET
@@ -2329,6 +2333,8 @@
device_desc.bcdDevice = __constant_cpu_to_le16 (0x0207);
} else if (gadget_is_omap (gadget)) {
device_desc.bcdDevice = __constant_cpu_to_le16 (0x0208);
+ } else if (gadget_is_lh7a40x(gadget)) {
+ device_desc.bcdDevice = __constant_cpu_to_le16 (0x0209);
} else {
/* can't assume CDC works. don't want to default to
* anything less functional on CDC-capable hardware,
diff -Nru a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
--- a/drivers/usb/gadget/file_storage.c 2004-08-26 16:43:15 -07:00
+++ b/drivers/usb/gadget/file_storage.c 2004-08-26 16:43:15 -07:00
@@ -3713,6 +3713,8 @@
mod_data.release = __constant_cpu_to_le16(0x0307);
else if (gadget_is_omap(fsg->gadget))
mod_data.release = __constant_cpu_to_le16(0x0308);
+ else if (gadget_is_lh7a40x(gadget))
+ mod_data.release = __constant_cpu_to_le16 (0x0309);
else {
WARN(fsg, "controller '%s' not recognized\n",
fsg->gadget->name);
diff -Nru a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
--- a/drivers/usb/gadget/gadget_chips.h 2004-08-26 16:43:15 -07:00
+++ b/drivers/usb/gadget/gadget_chips.h 2004-08-26 16:43:15 -07:00
@@ -44,6 +44,12 @@
#define gadget_is_sa1100(g) 0
#endif
+#ifdef CONFIG_USB_GADGET_LH7A40X
+#define gadget_is_lh7a40x(g) !strcmp("lh7a40x_udc", (g)->name)
+#else
+#define gadget_is_lh7a40x(g) 0
+#endif
+
#ifdef CONFIG_USB_GADGET_MQ11XX
#define gadget_is_mq11xx(g) !strcmp("mq11xx_udc", (g)->name)
#else
diff -Nru a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
--- a/drivers/usb/gadget/inode.c 2004-08-26 16:43:15 -07:00
+++ b/drivers/usb/gadget/inode.c 2004-08-26 16:43:15 -07:00
@@ -261,6 +261,10 @@
#define CHIP "sa1100"
#endif
+#ifdef CONFIG_USB_GADGET_LH7A40X
+#define CHIP "lh7a40x_udc"
+#endif
+
/*----------------------------------------------------------------------*/
/* NOTE: don't use dev_printk calls before binding to the gadget
diff -Nru a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
--- a/drivers/usb/gadget/serial.c 2004-08-26 16:43:15 -07:00
+++ b/drivers/usb/gadget/serial.c 2004-08-26 16:43:15 -07:00
@@ -1299,6 +1299,9 @@
} else if (gadget_is_omap(gadget)) {
gs_device_desc.bcdDevice =
__constant_cpu_to_le16(GS_VERSION_NUM|0x0007);
+ } else if (gadget_is_lh7a40x(gadget)) {
+ gs_device_desc.bcdDevice =
+ __constant_cpu_to_le16(GS_VERSION_NUM|0x0008);
} else {
printk(KERN_WARNING "gs_bind: controller '%s' not recognized\n",
gadget->name);
diff -Nru a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
--- a/drivers/usb/gadget/zero.c 2004-08-26 16:43:15 -07:00
+++ b/drivers/usb/gadget/zero.c 2004-08-26 16:43:15 -07:00
@@ -1185,6 +1185,8 @@
device_desc.bcdDevice = __constant_cpu_to_le16 (0x0207);
} else if (gadget_is_omap (gadget)) {
device_desc.bcdDevice = __constant_cpu_to_le16 (0x0208);
+ } else if (gadget_is_lh7a40x(gadget)) {
+ device_desc.bcdDevice = __constant_cpu_to_le16 (0x0209);
} else {
/* gadget zero is so simple (for now, no altsettings) that
* it SHOULD NOT have problems with bulk-capable hardware.
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel