ChangeSet 1.1832.55.63, 2004/09/09 16:05:48-07:00, [EMAIL PROTECTED]

[PATCH] USB: gadget_is_n9604

This adds recognition of one more UDC driver.
(Driver is available separately.)


Tell gadget drivers about the National 9603/9604 UDC.

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 |    4 +++-
 drivers/usb/gadget/gadget_chips.h |    6 ++++++
 drivers/usb/gadget/zero.c         |    2 ++
 4 files changed, 17 insertions(+), 1 deletion(-)


diff -Nru a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
--- a/drivers/usb/gadget/ether.c        2004-10-19 08:15:03 -07:00
+++ b/drivers/usb/gadget/ether.c        2004-10-19 08:15:03 -07:00
@@ -231,6 +231,10 @@
 #define        DEV_CONFIG_CDC
 #endif
 
+#ifdef CONFIG_USB_GADGET_N9604
+#define        DEV_CONFIG_CDC
+#endif
+
 
 /* For CDC-incapable hardware, choose the simple cdc subset.
  * Anything that talks bulk (without notable bugs) can do this.
@@ -2334,6 +2338,8 @@
                device_desc.bcdDevice = __constant_cpu_to_le16 (0x0208);
        } else if (gadget_is_lh7a40x(gadget)) {
                device_desc.bcdDevice = __constant_cpu_to_le16 (0x0209);
+       } else if (gadget_is_n9604(gadget)) {
+               device_desc.bcdDevice = __constant_cpu_to_le16 (0x020a);
        } 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-10-19 08:15:03 -07:00
+++ b/drivers/usb/gadget/file_storage.c 2004-10-19 08:15:03 -07:00
@@ -3728,8 +3728,10 @@
                        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))
+               else if (gadget_is_lh7a40x(fsg->gadget))
                        mod_data.release = __constant_cpu_to_le16 (0x0309);
+               else if (gadget_is_n9604(fsg->gadget))
+                       mod_data.release = __constant_cpu_to_le16 (0x030a);
                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-10-19 08:15:03 -07:00
+++ b/drivers/usb/gadget/gadget_chips.h 2004-10-19 08:15:03 -07:00
@@ -62,6 +62,12 @@
 #define        gadget_is_omap(g)       0
 #endif
 
+#ifdef CONFIG_USB_GADGET_N9604
+#define        gadget_is_n9604(g)      !strcmp("n9604_udc", (g)->name)
+#else
+#define        gadget_is_n9604(g)      0
+#endif
+
 // CONFIG_USB_GADGET_AT91RM9200
 // CONFIG_USB_GADGET_SX2
 // CONFIG_USB_GADGET_AU1X00
diff -Nru a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
--- a/drivers/usb/gadget/zero.c 2004-10-19 08:15:03 -07:00
+++ b/drivers/usb/gadget/zero.c 2004-10-19 08:15:03 -07:00
@@ -1188,6 +1188,8 @@
                device_desc.bcdDevice = __constant_cpu_to_le16 (0x0208);
        } else if (gadget_is_lh7a40x(gadget)) {
                device_desc.bcdDevice = __constant_cpu_to_le16 (0x0209);
+       } else if (gadget_is_n9604(gadget)) {
+               device_desc.bcdDevice = __constant_cpu_to_le16 (0x020a);
        } else {
                /* gadget zero is so simple (for now, no altsettings) that
                 * it SHOULD NOT have problems with bulk-capable hardware.



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to