diff options
author | Mathias Nyman <mathias.nyman@linux.intel.com> | 2013-07-23 04:35:47 -0400 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2013-07-23 17:50:29 -0400 |
commit | 26b76798e0507429506b93cd49f8c4cfdab06896 (patch) | |
tree | 264be6752d1b833de4807f33c18f971993c0f952 /drivers/usb/host/xhci-pci.c | |
parent | 063ebeb4335312d05bdf6fb4fc0e41500c6c0afb (diff) |
Intel xhci: refactor EHCI/xHCI port switching
Make the Linux xHCI driver automatically try to switchover the EHCI ports to
xHCI when an Intel xHCI host is detected, and it also finds an Intel EHCI host.
This means we will no longer have to add Intel xHCI hosts to a quirks list when
the PCI device IDs change. Simply continuing to add new Intel xHCI PCI device
IDs to the quirks list is not sustainable.
During suspend ports may be swicthed back to EHCI by BIOS and not properly
restored to xHCI at resume. Previously both EHCI and xHCI resume functions
switched ports back to XHCI, but it's enough to do it in xHCI only
because the hub driver doesn't start running again until after both hosts are resumed.
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/xhci-pci.c')
-rw-r--r-- | drivers/usb/host/xhci-pci.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index cc24e39b97d5..475e06e10a77 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -250,13 +250,15 @@ static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated) | |||
250 | * writers. | 250 | * writers. |
251 | * | 251 | * |
252 | * Unconditionally switch the ports back to xHCI after a system resume. | 252 | * Unconditionally switch the ports back to xHCI after a system resume. |
253 | * We can't tell whether the EHCI or xHCI controller will be resumed | 253 | * It should not matter whether the EHCI or xHCI controller is |
254 | * first, so we have to do the port switchover in both drivers. Writing | 254 | * resumed first. It's enough to do the switchover in xHCI because |
255 | * a '1' to the port switchover registers should have no effect if the | 255 | * USB core won't notice anything as the hub driver doesn't start |
256 | * port was already switched over. | 256 | * running again until after all the devices (including both EHCI and |
257 | * xHCI host controllers) have been resumed. | ||
257 | */ | 258 | */ |
258 | if (usb_is_intel_switchable_xhci(pdev)) | 259 | |
259 | usb_enable_xhci_ports(pdev); | 260 | if (pdev->vendor == PCI_VENDOR_ID_INTEL) |
261 | usb_enable_intel_xhci_ports(pdev); | ||
260 | 262 | ||
261 | retval = xhci_resume(xhci, hibernated); | 263 | retval = xhci_resume(xhci, hibernated); |
262 | return retval; | 264 | return retval; |