diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2012-07-05 20:17:24 -0400 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2012-07-11 07:06:48 -0400 |
commit | 024f117c2f3c4bb5df6e6696b709e0f3ed7e5dbb (patch) | |
tree | 3ad556877608c58bd7844f82810dfc0d471d4f63 /drivers/usb/core/sysfs.c | |
parent | f74631e3426474183389e55f703797bd965cd356 (diff) |
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 'drivers/usb/core/sysfs.c')
-rw-r--r-- | drivers/usb/core/sysfs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index 777f03c37725..682e8256b95d 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c | |||
@@ -253,6 +253,15 @@ show_removable(struct device *dev, struct device_attribute *attr, char *buf) | |||
253 | } | 253 | } |
254 | static DEVICE_ATTR(removable, S_IRUGO, show_removable, NULL); | 254 | static DEVICE_ATTR(removable, S_IRUGO, show_removable, NULL); |
255 | 255 | ||
256 | static ssize_t | ||
257 | show_ltm_capable(struct device *dev, struct device_attribute *attr, char *buf) | ||
258 | { | ||
259 | if (usb_device_supports_ltm(to_usb_device(dev))) | ||
260 | return sprintf(buf, "%s\n", "yes"); | ||
261 | return sprintf(buf, "%s\n", "no"); | ||
262 | } | ||
263 | static DEVICE_ATTR(ltm_capable, S_IRUGO, show_ltm_capable, NULL); | ||
264 | |||
256 | #ifdef CONFIG_PM | 265 | #ifdef CONFIG_PM |
257 | 266 | ||
258 | static ssize_t | 267 | static ssize_t |
@@ -649,6 +658,7 @@ static struct attribute *dev_attrs[] = { | |||
649 | &dev_attr_authorized.attr, | 658 | &dev_attr_authorized.attr, |
650 | &dev_attr_remove.attr, | 659 | &dev_attr_remove.attr, |
651 | &dev_attr_removable.attr, | 660 | &dev_attr_removable.attr, |
661 | &dev_attr_ltm_capable.attr, | ||
652 | NULL, | 662 | NULL, |
653 | }; | 663 | }; |
654 | static struct attribute_group dev_attr_grp = { | 664 | static struct attribute_group dev_attr_grp = { |