summaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2012-07-05 17:17:24 -0700
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2012-07-11 07:06:48 -0400
commit024f117c2f3c4bb5df6e6696b709e0f3ed7e5dbb (patch)
tree3ad556877608c58bd7844f82810dfc0d471d4f63 /include/linux/usb.h
parentf74631e3426474183389e55f703797bd965cd356 (diff)
downloadblackbird-op-linux-024f117c2f3c4bb5df6e6696b709e0f3ed7e5dbb.tar.gz
blackbird-op-linux-024f117c2f3c4bb5df6e6696b709e0f3ed7e5dbb.zip
USB: Add a sysfs file to show LTM capabilities.
USB 3.0 devices can optionally support Latency Tolerance Messaging (LTM). Add a new sysfs file in the device directory to show whether a device is LTM capable. This file will be present for both USB 2.0 and USB 3.0 devices. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index f29831bad235..f8506ed0f97b 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -636,6 +636,14 @@ extern void usb_unlocked_enable_lpm(struct usb_device *udev);
extern int usb_disable_ltm(struct usb_device *udev);
extern void usb_enable_ltm(struct usb_device *udev);
+static inline bool usb_device_supports_ltm(struct usb_device *udev)
+{
+ if (udev->speed != USB_SPEED_SUPER || !udev->bos || !udev->bos->ss_cap)
+ return false;
+ return udev->bos->ss_cap->bmAttributes & USB_LTM_SUPPORT;
+}
+
+
/*-------------------------------------------------------------------------*/
/* for drivers using iso endpoints */
OpenPOWER on IntegriCloud