aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-hub.c
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2012-06-25 11:24:30 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2012-07-11 07:06:48 -0400
commitaf3a23ef4e5fbaf33f0afdda7d26442f036ba795 (patch)
tree0c88de5b3c224cc720dbb2b63b4b9e5def22ea05 /drivers/usb/host/xhci-hub.c
parentc5c4bdf02e518a281b229ae0891b346919e2d291 (diff)
xhci: Export Latency Tolerance Messaging capabilities.
Some xHCI host controllers may have optional support for Latency Tolerance Messaging (LTM). This allows USB 3.0 devices that support LTM to pass information about how much latency they can tolerate to the xHC. A PCI xHCI host will use this information to update the PCI Latency Tolerance Request (LTR) info. The goal of this is to gather latency information for the system, to enable hardware-driven C states, and the shutting down of PLLs. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci-hub.c')
-rw-r--r--drivers/usb/host/xhci-hub.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 2732ef660c5c..6d21030e2b7b 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -508,12 +508,18 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
508 if (hcd->speed != HCD_USB3) 508 if (hcd->speed != HCD_USB3)
509 goto error; 509 goto error;
510 510
511 /* Set the U1 and U2 exit latencies. */
511 memcpy(buf, &usb_bos_descriptor, 512 memcpy(buf, &usb_bos_descriptor,
512 USB_DT_BOS_SIZE + USB_DT_USB_SS_CAP_SIZE); 513 USB_DT_BOS_SIZE + USB_DT_USB_SS_CAP_SIZE);
513 temp = xhci_readl(xhci, &xhci->cap_regs->hcs_params3); 514 temp = xhci_readl(xhci, &xhci->cap_regs->hcs_params3);
514 buf[12] = HCS_U1_LATENCY(temp); 515 buf[12] = HCS_U1_LATENCY(temp);
515 put_unaligned_le16(HCS_U2_LATENCY(temp), &buf[13]); 516 put_unaligned_le16(HCS_U2_LATENCY(temp), &buf[13]);
516 517
518 /* Indicate whether the host has LTM support. */
519 temp = xhci_readl(xhci, &xhci->cap_regs->hcc_params);
520 if (HCC_LTC(temp))
521 buf[8] |= USB_LTM_SUPPORT;
522
517 spin_unlock_irqrestore(&xhci->lock, flags); 523 spin_unlock_irqrestore(&xhci->lock, flags);
518 return USB_DT_BOS_SIZE + USB_DT_USB_SS_CAP_SIZE; 524 return USB_DT_BOS_SIZE + USB_DT_USB_SS_CAP_SIZE;
519 case GetPortStatus: 525 case GetPortStatus: