aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/gadget.h
diff options
context:
space:
mode:
authorJohn Youn <johnyoun@synopsys.com>2017-04-28 12:55:20 +0400
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-06-02 11:22:32 +0300
commita9548c55295a4268f9187e1ec93264a0682fa745 (patch)
tree5ea14d14aa8845ffb1507bd2731a4cd62aa55c3d /include/linux/usb/gadget.h
parentusb: gadget: composite: Exclude SS Dev Cap Desc (diff)
downloadlinux-dev-a9548c55295a4268f9187e1ec93264a0682fa745.tar.xz
linux-dev-a9548c55295a4268f9187e1ec93264a0682fa745.zip
usb: gadget: Allow a non-SuperSpeed gadget to support LPM
This commit allows a gadget that does not support SuperSpeed to indicate that it supports LPM. It does this by setting the 'lpm_capable' flag in the gadget structure. If a gadget sets this, the composite gadget framework will set the bcdUSB to 0x0201 to indicate that this supports BOS descriptors, and also return a USB 2.0 Extension descriptor as part of the BOS descriptor set. See USB 2.0 LPM ECN Section 3. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Sevak Arakelyan <sevaka@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'include/linux/usb/gadget.h')
-rw-r--r--include/linux/usb/gadget.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index fbc22a39e7bc..3ee5f2a7c0b4 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -352,6 +352,8 @@ struct usb_gadget_ops {
* @deactivated: True if gadget is deactivated - in deactivated state it cannot
* be connected.
* @connected: True if gadget is connected.
+ * @lpm_capable: If the gadget max_speed is FULL or HIGH, this flag
+ * indicates that it supports LPM as per the LPM ECN & errata.
*
* Gadgets have a mostly-portable "gadget driver" implementing device
* functions, handling all usb configurations and interfaces. Gadget
@@ -404,6 +406,7 @@ struct usb_gadget {
unsigned is_selfpowered:1;
unsigned deactivated:1;
unsigned connected:1;
+ unsigned lpm_capable:1;
};
#define work_to_gadget(w) (container_of((w), struct usb_gadget, work))