diff options
Diffstat (limited to 'drivers/usb/gadget/gadget_chips.h')
-rw-r--r-- | drivers/usb/gadget/gadget_chips.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h index ca5149ea7312..5246e8fef2b2 100644 --- a/drivers/usb/gadget/gadget_chips.h +++ b/drivers/usb/gadget/gadget_chips.h | |||
@@ -214,3 +214,26 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget) | |||
214 | return 0x21; | 214 | return 0x21; |
215 | return -ENOENT; | 215 | return -ENOENT; |
216 | } | 216 | } |
217 | |||
218 | |||
219 | /** | ||
220 | * gadget_supports_altsettings - return true if altsettings work | ||
221 | * @gadget: the gadget in question | ||
222 | */ | ||
223 | static inline bool gadget_supports_altsettings(struct usb_gadget *gadget) | ||
224 | { | ||
225 | /* PXA 21x/25x/26x has no altsettings at all */ | ||
226 | if (gadget_is_pxa(gadget)) | ||
227 | return false; | ||
228 | |||
229 | /* PXA 27x and 3xx have *broken* altsetting support */ | ||
230 | if (gadget_is_pxa27x(gadget)) | ||
231 | return false; | ||
232 | |||
233 | /* SH3 hardware just doesn't do altsettings */ | ||
234 | if (gadget_is_sh(gadget)) | ||
235 | return false; | ||
236 | |||
237 | /* Everything else is *presumably* fine ... */ | ||
238 | return true; | ||
239 | } | ||