X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fusb%2Fgadget%2Fgadget_chips.h;h=5246e8fef2b276b28d5e64095fa77493eae91232;hb=5554b35933245e95710d709175e14c02cbc956a4;hp=e7fbefefe7b0460b6ca07b10a7e99918ed26b3bc;hpb=55d402d854ade6b63b26e958f201ee2ef00b7b15;p=linux-2.6 diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h index e7fbefefe7..5246e8fef2 100644 --- a/drivers/usb/gadget/gadget_chips.h +++ b/drivers/usb/gadget/gadget_chips.h @@ -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 @@ -211,6 +211,29 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget) else if (gadget_is_amd5536udc(gadget)) return 0x20; else if (gadget_is_m66592(gadget)) - return 0x20; + 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; +}