]> err.no Git - linux-2.6/blobdiff - drivers/usb/gadget/gadget_chips.h
usb ethernet gadget: split CDC Ethernet function
[linux-2.6] / drivers / usb / gadget / gadget_chips.h
index 9c84b385ca88f8ff42fb66dbc2df634bb1b95122..5246e8fef2b276b28d5e64095fa77493eae91232 100644 (file)
 #define        gadget_is_net2280(g)    0
 #endif
 
+#ifdef CONFIG_USB_GADGET_AMD5536UDC
+#define        gadget_is_amd5536udc(g) !strcmp("amd5536udc", (g)->name)
+#else
+#define        gadget_is_amd5536udc(g) 0
+#endif
+
 #ifdef CONFIG_USB_GADGET_DUMMY_HCD
 #define        gadget_is_dummy(g)      !strcmp("dummy_udc", (g)->name)
 #else
 #define        gadget_is_dummy(g)      0
 #endif
 
-#ifdef CONFIG_USB_GADGET_PXA2XX
-#define        gadget_is_pxa(g)        !strcmp("pxa2xx_udc", (g)->name)
+#ifdef CONFIG_USB_GADGET_PXA25X
+#define        gadget_is_pxa(g)        !strcmp("pxa25x_udc", (g)->name)
 #else
 #define        gadget_is_pxa(g)        0
 #endif
 #define        gadget_is_pxa27x(g)     0
 #endif
 
-#ifdef CONFIG_USB_GADGET_HUSB2DEV
-#define gadget_is_husb2dev(g)  !strcmp("husb2_udc", (g)->name)
+#ifdef CONFIG_USB_GADGET_ATMEL_USBA
+#define gadget_is_atmel_usba(g)        !strcmp("atmel_usba_udc", (g)->name)
 #else
-#define gadget_is_husb2dev(g)  0
+#define gadget_is_atmel_usba(g)        0
 #endif
 
 #ifdef CONFIG_USB_GADGET_S3C2410
@@ -198,11 +204,36 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
                return 0x16;
        else if (gadget_is_mpc8272(gadget))
                return 0x17;
-       else if (gadget_is_husb2dev(gadget))
+       else if (gadget_is_atmel_usba(gadget))
                return 0x18;
        else if (gadget_is_fsl_usb2(gadget))
                return 0x19;
-       else if (gadget_is_m66592(gadget))
+       else if (gadget_is_amd5536udc(gadget))
                return 0x20;
+       else if (gadget_is_m66592(gadget))
+               return 0x21;
        return -ENOENT;
 }
+
+
+/**
+ * gadget_supports_altsettings - return true if altsettings work
+ * @gadget: the gadget in question
+ */
+static inline bool gadget_supports_altsettings(struct usb_gadget *gadget)
+{
+       /* PXA 21x/25x/26x has no altsettings at all */
+       if (gadget_is_pxa(gadget))
+               return false;
+
+       /* PXA 27x and 3xx have *broken* altsetting support */
+       if (gadget_is_pxa27x(gadget))
+               return false;
+
+       /* SH3 hardware just doesn't do altsettings */
+       if (gadget_is_sh(gadget))
+               return false;
+
+       /* Everything else is *presumably* fine ... */
+       return true;
+}