summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-12-19 14:57:04 +0400
committerFelipe Balbi <balbi@ti.com>2013-03-18 13:17:12 +0400
commit49401f4169c0e5a1b38f1a676d6f12eecaf77485 (patch)
tree274f68e04c13e7bf959cd7878eb22ffde16813b6 /include
parentd1e3d757f7aa91f15db347fc05ffd7ef7f413091 (diff)
downloadlinux-49401f4169c0e5a1b38f1a676d6f12eecaf77485.tar.xz
usb: gadget: introduce gadget state tracking
that's useful information to expose to userland. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb/gadget.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 2e297e80d59a..32b734d88d6b 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -482,6 +482,7 @@ struct usb_gadget_ops {
* @speed: Speed of current connection to USB host.
* @max_speed: Maximal speed the UDC can handle. UDC must support this
* and all slower speeds.
+ * @state: the state we are now (attached, suspended, configured, etc)
* @sg_supported: true if we can handle scatter-gather
* @is_otg: True if the USB device port uses a Mini-AB jack, so that the
* gadget driver must provide a USB OTG descriptor.
@@ -525,6 +526,7 @@ struct usb_gadget {
struct list_head ep_list; /* of usb_ep */
enum usb_device_speed speed;
enum usb_device_speed max_speed;
+ enum usb_device_state state;
unsigned sg_supported:1;
unsigned is_otg:1;
unsigned is_a_peripheral:1;
@@ -959,6 +961,13 @@ extern void usb_gadget_unmap_request(struct usb_gadget *gadget,
/*-------------------------------------------------------------------------*/
+/* utility to set gadget state properly */
+
+extern void usb_gadget_set_state(struct usb_gadget *gadget,
+ enum usb_device_state state);
+
+/*-------------------------------------------------------------------------*/
+
/* utility wrapping a simple endpoint selection policy */
extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *,