diff options
| author | Mathias Nyman <mathias.nyman@linux.intel.com> | 2015-07-21 10:20:25 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-22 17:19:36 -0400 |
| commit | c3c5819a350952439c3198aa46581f9e4c46557f (patch) | |
| tree | 1dbea158a3556f2aa30b79078a26185c65f4abb3 | |
| parent | ed877b130dded73fbc6474ae935fce6d18c1a646 (diff) | |
xhci: call BIOS workaround to enable runtime suspend on Intel Braswell
Intel xhci hw that require XHCI_PME_STUCK quirk have as default disabled
xhci from going to D3 state in runtime suspend. Driver needs to verify
it can deal with the hw by calling an ACPI _DSM method to get D3 enabled.
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/usb/host/xhci-pci.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 4a4cb1d91ac8..da10dc728acb 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/pci.h> | 23 | #include <linux/pci.h> |
| 24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
| 25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
| 26 | #include <linux/acpi.h> | ||
| 26 | 27 | ||
| 27 | #include "xhci.h" | 28 | #include "xhci.h" |
| 28 | #include "xhci-trace.h" | 29 | #include "xhci-trace.h" |
| @@ -190,6 +191,19 @@ static void xhci_pme_quirk(struct xhci_hcd *xhci) | |||
| 190 | readl(reg); | 191 | readl(reg); |
| 191 | } | 192 | } |
| 192 | 193 | ||
| 194 | #ifdef CONFIG_ACPI | ||
| 195 | static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) | ||
| 196 | { | ||
| 197 | static const u8 intel_dsm_uuid[] = { | ||
| 198 | 0xb7, 0x0c, 0x34, 0xac, 0x01, 0xe9, 0xbf, 0x45, | ||
| 199 | 0xb7, 0xe6, 0x2b, 0x34, 0xec, 0x93, 0x1e, 0x23, | ||
| 200 | }; | ||
| 201 | acpi_evaluate_dsm(ACPI_HANDLE(&dev->dev), intel_dsm_uuid, 3, 1, NULL); | ||
| 202 | } | ||
| 203 | #else | ||
| 204 | static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } | ||
| 205 | #endif /* CONFIG_ACPI */ | ||
| 206 | |||
| 193 | /* called during probe() after chip reset completes */ | 207 | /* called during probe() after chip reset completes */ |
| 194 | static int xhci_pci_setup(struct usb_hcd *hcd) | 208 | static int xhci_pci_setup(struct usb_hcd *hcd) |
| 195 | { | 209 | { |
| @@ -263,6 +277,9 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 263 | HCC_MAX_PSA(xhci->hcc_params) >= 4) | 277 | HCC_MAX_PSA(xhci->hcc_params) >= 4) |
| 264 | xhci->shared_hcd->can_do_streams = 1; | 278 | xhci->shared_hcd->can_do_streams = 1; |
| 265 | 279 | ||
| 280 | if (xhci->quirks & XHCI_PME_STUCK_QUIRK) | ||
| 281 | xhci_pme_acpi_rtd3_enable(dev); | ||
| 282 | |||
| 266 | /* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */ | 283 | /* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */ |
| 267 | pm_runtime_put_noidle(&dev->dev); | 284 | pm_runtime_put_noidle(&dev->dev); |
| 268 | 285 | ||
