ChangeSet 1.2181.4.9, 2005/03/17 17:33:03-08:00, [EMAIL PROTECTED]

        [PATCH] USB: add at91_udc recognition
        
        Add declarations to recognize the AT91 USB peripheral controller,
        as used in various ARMv4T chips including the mmu-ful at91rm9200.
        
        Signed-off-by: David Brownell <[EMAIL PROTECTED]>
        Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>



 ether.c        |    6 ++++++
 file_storage.c |    4 ++++
 gadget_chips.h |    7 ++++++-
 serial.c       |    3 +++
 zero.c         |    2 ++
 5 files changed, 21 insertions(+), 1 deletion(-)


diff -Nru a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
--- a/drivers/usb/gadget/ether.c        2005-03-30 15:06:01 -08:00
+++ b/drivers/usb/gadget/ether.c        2005-03-30 15:06:01 -08:00
@@ -243,6 +243,10 @@
 #define DEV_CONFIG_CDC
 #endif
 
+#ifdef CONFIG_USB_GADGET_AT91
+#define DEV_CONFIG_CDC
+#endif
+
 
 /* For CDC-incapable hardware, choose the simple cdc subset.
  * Anything that talks bulk (without notable bugs) can do this.
@@ -2251,6 +2255,8 @@
                device_desc.bcdDevice = __constant_cpu_to_le16 (0x0211);
        } else if (gadget_is_s3c2410(gadget)) {
                device_desc.bcdDevice = __constant_cpu_to_le16 (0x0212);
+       } else if (gadget_is_at91(gadget)) {
+               device_desc.bcdDevice = __constant_cpu_to_le16 (0x0213);
        } 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 2005-03-30 15:06:01 -08:00
+++ b/drivers/usb/gadget/file_storage.c 2005-03-30 15:06:01 -08:00
@@ -3740,6 +3740,10 @@
                        mod_data.release = 0x0310;
                else if (gadget_is_pxa27x(fsg->gadget))
                        mod_data.release = 0x0311;
+               else if (gadget_is_s3c2410(gadget))
+                       mod_data.release = 0x0312;
+               else if (gadget_is_at91(fsg->gadget))
+                       mod_data.release = 0x0313;
                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 2005-03-30 15:06:01 -08:00
+++ b/drivers/usb/gadget/gadget_chips.h 2005-03-30 15:06:01 -08:00
@@ -80,7 +80,12 @@
 #define gadget_is_s3c2410(g)    0
 #endif
 
-// CONFIG_USB_GADGET_AT91RM9200
+#ifdef CONFIG_USB_GADGET_AT91
+#define gadget_is_at91(g)      !strcmp("at91_udc", (g)->name)
+#else
+#define gadget_is_at91(g)      0
+#endif
+
 // CONFIG_USB_GADGET_SX2
 // CONFIG_USB_GADGET_AU1X00
 // ...
diff -Nru a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
--- a/drivers/usb/gadget/serial.c       2005-03-30 15:06:01 -08:00
+++ b/drivers/usb/gadget/serial.c       2005-03-30 15:06:01 -08:00
@@ -1461,6 +1461,9 @@
        } else if (gadget_is_s3c2410(gadget)) {
                gs_device_desc.bcdDevice =
                        __constant_cpu_to_le16(GS_VERSION_NUM|0x0012);
+       } else if (gadget_is_at91(gadget)) {
+               gs_device_desc.bcdDevice =
+                       __constant_cpu_to_le16(GS_VERSION_NUM|0x0013);
        } 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 2005-03-30 15:06:01 -08:00
+++ b/drivers/usb/gadget/zero.c 2005-03-30 15:06:01 -08:00
@@ -1193,6 +1193,8 @@
                device_desc.bcdDevice = __constant_cpu_to_le16 (0x0211);
        } else if (gadget_is_s3c2410(gadget)) {
                device_desc.bcdDevice = __constant_cpu_to_le16 (0x0212);
+       } else if (gadget_is_at91(gadget)) {
+               device_desc.bcdDevice = __constant_cpu_to_le16 (0x0213);
        } else {
                /* gadget zero is so simple (for now, no altsettings) that
                 * it SHOULD NOT have problems with bulk-capable hardware.
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to