Merge branch 'release-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/ak...
[pandora-kernel.git] / drivers / usb / gadget / gadget_chips.h
index f7f159c..5246e8f 100644 (file)
@@ -29,8 +29,8 @@
 #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
@@ -214,3 +214,26 @@ static inline int usb_gadget_controller_number(struct usb_gadget *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;
+}