aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2013-05-23 10:14:31 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2013-06-05 19:48:40 -0400
commit17f34867e98d2fb0c03918faab79efb989fa134b (patch)
tree1ea3f266473f6d6aa7fec9a646e04158941d0a06 /drivers/usb/host
parenta558ccdcc71c7770c5e80c926a31cfe8a3892a09 (diff)
usb: add usb2 Link PM variables to sysfs and usb_device
Adds abitilty to tune L1 timeout (inactivity timer for usb2 link sleep) and BESL (best effort service latency)via sysfs. This also adds a new usb2_lpm_parameters structure with those variables to struct usb_device. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/xhci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 3d34a0eed088..8be34f838bd4 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3917,7 +3917,7 @@ static int xhci_calculate_usb2_hw_lpm_params(struct usb_device *udev)
3917 field = le32_to_cpu(udev->bos->ext_cap->bmAttributes); 3917 field = le32_to_cpu(udev->bos->ext_cap->bmAttributes);
3918 3918
3919 /* xHCI l1 is set in steps of 256us, xHCI 1.0 section 5.4.11.2 */ 3919 /* xHCI l1 is set in steps of 256us, xHCI 1.0 section 5.4.11.2 */
3920 l1 = XHCI_L1_TIMEOUT / 256; 3920 l1 = udev->l1_params.timeout / 256;
3921 3921
3922 /* device has preferred BESLD */ 3922 /* device has preferred BESLD */
3923 if (field & USB_BESL_DEEP_VALID) { 3923 if (field & USB_BESL_DEEP_VALID) {
@@ -4101,7 +4101,7 @@ int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
4101 (field & USB_BESL_BASELINE_VALID)) 4101 (field & USB_BESL_BASELINE_VALID))
4102 hird = USB_GET_BESL_BASELINE(field); 4102 hird = USB_GET_BESL_BASELINE(field);
4103 else 4103 else
4104 hird = XHCI_DEFAULT_BESL; 4104 hird = udev->l1_params.besl;
4105 4105
4106 exit_latency = xhci_besl_encoding[hird]; 4106 exit_latency = xhci_besl_encoding[hird];
4107 spin_unlock_irqrestore(&xhci->lock, flags); 4107 spin_unlock_irqrestore(&xhci->lock, flags);
@@ -4191,6 +4191,8 @@ int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
4191 if (xhci->hw_lpm_support == 1 && 4191 if (xhci->hw_lpm_support == 1 &&
4192 xhci_check_usb2_port_capability(xhci, portnum, XHCI_HLC)) { 4192 xhci_check_usb2_port_capability(xhci, portnum, XHCI_HLC)) {
4193 udev->usb2_hw_lpm_capable = 1; 4193 udev->usb2_hw_lpm_capable = 1;
4194 udev->l1_params.timeout = XHCI_L1_TIMEOUT;
4195 udev->l1_params.besl = XHCI_DEFAULT_BESL;
4194 if (xhci_check_usb2_port_capability(xhci, portnum, 4196 if (xhci_check_usb2_port_capability(xhci, portnum,
4195 XHCI_BLC)) 4197 XHCI_BLC))
4196 udev->usb2_hw_lpm_besl_capable = 1; 4198 udev->usb2_hw_lpm_besl_capable = 1;