diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2008-06-20 03:19:46 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-22 00:16:13 +0200 |
commit | da741b8c56d612b5dd26ffa31341911a5fea23ee (patch) | |
tree | 201018abff24086e048a7dbf96ae07e60a82433e /drivers/usb/gadget/gadget_chips.h | |
parent | usb ethernet gadget: split CDC Subset function (diff) | |
download | linux-da741b8c56d612b5dd26ffa31341911a5fea23ee.tar.xz linux-da741b8c56d612b5dd26ffa31341911a5fea23ee.zip |
usb ethernet gadget: split CDC Ethernet function
This is a "CDC Ethernet" (ECM) function driver, extracted from the
all-in-one Ethernet gadget driver.
This is a good example of how to implement interface altsettings.
In fact it's currently the only such example in the gadget stack,
pending addition of OBEX support.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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) 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; +} |