summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/gadget_chips.h
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-06-19 18:19:46 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-07-21 15:16:13 -0700
commitda741b8c56d612b5dd26ffa31341911a5fea23ee (patch)
tree201018abff24086e048a7dbf96ae07e60a82433e /drivers/usb/gadget/gadget_chips.h
parent8a40819e97368f2b6e67fea103348f9fc2f68ceb (diff)
downloadblackbird-op-linux-da741b8c56d612b5dd26ffa31341911a5fea23ee.tar.gz
blackbird-op-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.h23
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;
+}
OpenPOWER on IntegriCloud