aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/driver.c
diff options
context:
space:
mode:
authorAndiry Xu <andiry.xu@amd.com>2011-09-23 17:19:52 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-09-26 18:51:10 -0400
commit65580b4321eb36f16ae8b5987bfa1bb948fc5112 (patch)
tree12735f923ad670c405efb5ab34c188dc06ad15f7 /drivers/usb/core/driver.c
parent9574323c39d1f8359a04843075d89c9f32d8b7e6 (diff)
xHCI: set USB2 hardware LPM
If the device pass the USB2 software LPM and the host supports hardware LPM, enable hardware LPM for the device to let the host decide when to put the link into lower power state. If hardware LPM is enabled for a port and driver wants to put it into suspend, it must first disable hardware LPM, resume the port into U0, and then suspend the port. Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/driver.c')
-rw-r--r--drivers/usb/core/driver.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 14b83f2a4e87..adf5ca8a2396 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1700,6 +1700,20 @@ int usb_runtime_idle(struct device *dev)
1700 return 0; 1700 return 0;
1701} 1701}
1702 1702
1703int usb_set_usb2_hardware_lpm(struct usb_device *udev, int enable)
1704{
1705 struct usb_hcd *hcd = bus_to_hcd(udev->bus);
1706 int ret = -EPERM;
1707
1708 if (hcd->driver->set_usb2_hw_lpm) {
1709 ret = hcd->driver->set_usb2_hw_lpm(hcd, udev, enable);
1710 if (!ret)
1711 udev->usb2_hw_lpm_enabled = enable;
1712 }
1713
1714 return ret;
1715}
1716
1703#endif /* CONFIG_USB_SUSPEND */ 1717#endif /* CONFIG_USB_SUSPEND */
1704 1718
1705struct bus_type usb_bus_type = { 1719struct bus_type usb_bus_type = {