summaryrefslogtreecommitdiff
path: root/include/linux/usb/composite.h
diff options
context:
space:
mode:
authorHemant Kumar <hemantk@codeaurora.org>2016-01-25 20:25:02 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:02:42 -0700
commit70ba8d2a946a2bbe736f97e3c3208fb39eaeef58 (patch)
treed9d990d49bfde817d9e24b5d898ec8dc911dd2fd /include/linux/usb/composite.h
parenta51f548a74c775fedf3f42e8635510406ce46bad (diff)
usb: gadget: add infrastructure support for super-speed function suspend
The USB 3.0 specification defines a new 'Function Suspend' feature. This feature enables the USB host to put inactive composite device functions in a suspended state even when the device itself is not suspended. This patch extends the existing framework of USB gadget to properly support the 'Function Resume' and 'Function Remote Wakeup' related features. Change-Id: I51713eac557eabc7b465d161377c09d4b6afa152 Signed-off-by: Danny Segal <dsegal@codeaurora.org>
Diffstat (limited to 'include/linux/usb/composite.h')
-rw-r--r--include/linux/usb/composite.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 15d7c311e86e..bbb5c4c619ed 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -154,7 +154,11 @@ struct usb_os_desc_table {
* @get_status: Returns function status as a reply to
* GetStatus() request when the recipient is Interface.
* @func_suspend: callback to be called when
- * SetFeature(FUNCTION_SUSPEND) is reseived
+ * SetFeature(FUNCTION_SUSPEND) is received
+ * @func_is_suspended: Tells whether the function is currently in
+ * Function Suspend state (used in Super Speed mode only).
+ * @func_wakeup_allowed: Tells whether Function Remote Wakeup has been allowed
+ * by the USB host (used in Super Speed mode only).
*
* A single USB function uses one or more interfaces, and should in most
* cases support operation at both full and high speeds. Each function is
@@ -223,6 +227,8 @@ struct usb_function {
int (*get_status)(struct usb_function *);
int (*func_suspend)(struct usb_function *,
u8 suspend_opt);
+ unsigned func_is_suspended:1;
+ unsigned func_wakeup_allowed:1;
/* private: */
/* internals */
struct list_head list;
@@ -238,6 +244,9 @@ int usb_function_deactivate(struct usb_function *);
int usb_function_activate(struct usb_function *);
int usb_interface_id(struct usb_configuration *, struct usb_function *);
+int usb_func_wakeup(struct usb_function *func);
+
+int usb_get_func_interface_id(struct usb_function *func);
int config_ep_by_speed(struct usb_gadget *g, struct usb_function *f,
struct usb_ep *_ep);