Commit 4750bc78 authored by Thang Q. Nguyen's avatar Thang Q. Nguyen Committed by Greg Kroah-Hartman

usb: host: xhci support option to disable the xHCI USB2 HW LPM

XHCI specification 1.1 does not require xHCI-compliant controllers
to always enable hardware USB2 LPM. However, the current xHCI
driver always enable it when seeing HLC=1.
This patch supports an option for users to control disabling
USB2 Hardware LPM via DT/ACPI attribute.
This option is needed in case user would like to disable this
feature. For example, their xHCI controller has its USB2 HW LPM
broken.
Signed-off-by: default avatarTung Nguyen <tunguyen@apm.com>
Signed-off-by: default avatarThang Q. Nguyen <tqnguyen@apm.com>
Acked-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fb9bbce6
...@@ -26,6 +26,7 @@ Required properties: ...@@ -26,6 +26,7 @@ Required properties:
Optional properties: Optional properties:
- clocks: reference to a clock - clocks: reference to a clock
- usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM
- usb3-lpm-capable: determines if platform is USB3 LPM capable - usb3-lpm-capable: determines if platform is USB3 LPM capable
- quirk-broken-port-ped: set if the controller has broken port disable mechanism - quirk-broken-port-ped: set if the controller has broken port disable mechanism
......
...@@ -259,6 +259,9 @@ static int xhci_plat_probe(struct platform_device *pdev) ...@@ -259,6 +259,9 @@ static int xhci_plat_probe(struct platform_device *pdev)
goto disable_clk; goto disable_clk;
} }
if (device_property_read_bool(sysdev, "usb2-lpm-disable"))
xhci->quirks |= XHCI_HW_LPM_DISABLE;
if (device_property_read_bool(sysdev, "usb3-lpm-capable")) if (device_property_read_bool(sysdev, "usb3-lpm-capable"))
xhci->quirks |= XHCI_LPM_SUPPORT; xhci->quirks |= XHCI_LPM_SUPPORT;
......
...@@ -4087,7 +4087,7 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, ...@@ -4087,7 +4087,7 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
xhci_dbg(xhci, "%s port %d USB2 hardware LPM\n", xhci_dbg(xhci, "%s port %d USB2 hardware LPM\n",
enable ? "enable" : "disable", port_num + 1); enable ? "enable" : "disable", port_num + 1);
if (enable) { if (enable && !(xhci->quirks & XHCI_HW_LPM_DISABLE)) {
/* Host supports BESL timeout instead of HIRD */ /* Host supports BESL timeout instead of HIRD */
if (udev->usb2_hw_lpm_besl_capable) { if (udev->usb2_hw_lpm_besl_capable) {
/* if device doesn't have a preferred BESL value use a /* if device doesn't have a preferred BESL value use a
......
...@@ -1828,6 +1828,7 @@ struct xhci_hcd { ...@@ -1828,6 +1828,7 @@ struct xhci_hcd {
#define XHCI_LIMIT_ENDPOINT_INTERVAL_7 (1 << 26) #define XHCI_LIMIT_ENDPOINT_INTERVAL_7 (1 << 26)
#define XHCI_U2_DISABLE_WAKE (1 << 27) #define XHCI_U2_DISABLE_WAKE (1 << 27)
#define XHCI_ASMEDIA_MODIFY_FLOWCONTROL (1 << 28) #define XHCI_ASMEDIA_MODIFY_FLOWCONTROL (1 << 28)
#define XHCI_HW_LPM_DISABLE (1 << 29)
unsigned int num_active_eps; unsigned int num_active_eps;
unsigned int limit_active_eps; unsigned int limit_active_eps;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment