diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-06 15:21:02 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-06 15:21:02 -0700 |
commit | 1c83d94ff646001f9ee83f0330a3933b55660927 (patch) | |
tree | 13733a673705e1fba9371eb328b15b7c2e81eea2 /drivers/usb/core | |
parent | 3a57aa8161a06133bc3142327f3b2f1a9a50f6c8 (diff) | |
parent | 17f34867e98d2fb0c03918faab79efb989fa134b (diff) | |
download | op-kernel-dev-1c83d94ff646001f9ee83f0330a3933b55660927.zip op-kernel-dev-1c83d94ff646001f9ee83f0330a3933b55660927.tar.gz |
Merge tag 'for-usb-next-2013-06-06' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-next
Sarah writes:
xHCI: USB 2.0 Link PM and misc cleanup patches
Hi Greg,
Here's six patches to be queued for 3.11.
The first four add support for a new type of host hardware-managed USB
2.0 Link Power Management. Hosts with BESL support, including Intel
Haswell ULT systems, will now be able to have USB 2.0 devices go into
the lower power link state (L1) in between packets. These patches have
been tested on Haswell ULT platforms with USB 2.0 webcams that support
Link PM.
The other two patches are clean up. One from Julius clarifies the xHCI
endpoint context debugging to make it consistent with standard endpoint
addresses, instead of xHCI endpoint context indexes. The one from Alex
changes the xHCI driver to be consistent about passing a void pointer to
the xHCI IRQ handler.
Sarah Sharp
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/sysfs.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index aa38db4..d9284b9 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -497,8 +497,62 @@ set_usb2_hardware_lpm(struct device *dev, struct device_attribute *attr, static DEVICE_ATTR(usb2_hardware_lpm, S_IRUGO | S_IWUSR, show_usb2_hardware_lpm, set_usb2_hardware_lpm); +static ssize_t +show_usb2_lpm_l1_timeout(struct device *dev, struct device_attribute *attr, + char *buf) +{ + struct usb_device *udev = to_usb_device(dev); + return sprintf(buf, "%d\n", udev->l1_params.timeout); +} + +static ssize_t +set_usb2_lpm_l1_timeout(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +{ + struct usb_device *udev = to_usb_device(dev); + u16 timeout; + + if (kstrtou16(buf, 0, &timeout)) + return -EINVAL; + + udev->l1_params.timeout = timeout; + + return count; +} + +static DEVICE_ATTR(usb2_lpm_l1_timeout, S_IRUGO | S_IWUSR, + show_usb2_lpm_l1_timeout, set_usb2_lpm_l1_timeout); + +static ssize_t +show_usb2_lpm_besl(struct device *dev, struct device_attribute *attr, + char *buf) +{ + struct usb_device *udev = to_usb_device(dev); + return sprintf(buf, "%d\n", udev->l1_params.besl); +} + +static ssize_t +set_usb2_lpm_besl(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +{ + struct usb_device *udev = to_usb_device(dev); + u8 besl; + + if (kstrtou8(buf, 0, &besl) || besl > 15) + return -EINVAL; + + udev->l1_params.besl = besl; + + return count; +} + +static DEVICE_ATTR(usb2_lpm_besl, S_IRUGO | S_IWUSR, + show_usb2_lpm_besl, set_usb2_lpm_besl); + static struct attribute *usb2_hardware_lpm_attr[] = { &dev_attr_usb2_hardware_lpm.attr, + &dev_attr_usb2_lpm_l1_timeout.attr, + &dev_attr_usb2_lpm_besl.attr, NULL, }; static struct attribute_group usb2_hardware_lpm_attr_group = { |