Merge tag 'mfd-3.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
[deliverable/linux.git] / drivers / usb / host / pci-quirks.c
index 32dada8c8b4f31e639227d120203482fe487d229..df0828cb2aa328ecf06cb37cb1a6981fa41d52f3 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <linux/types.h>
+#include <linux/kconfig.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/init.h>
@@ -712,12 +713,28 @@ static int handshake(void __iomem *ptr, u32 mask, u32 done,
        return -ETIMEDOUT;
 }
 
-bool usb_is_intel_switchable_xhci(struct pci_dev *pdev)
+#define PCI_DEVICE_ID_INTEL_LYNX_POINT_XHCI    0x8C31
+
+bool usb_is_intel_ppt_switchable_xhci(struct pci_dev *pdev)
 {
        return pdev->class == PCI_CLASS_SERIAL_USB_XHCI &&
                pdev->vendor == PCI_VENDOR_ID_INTEL &&
                pdev->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI;
 }
+
+/* The Intel Lynx Point chipset also has switchable ports. */
+bool usb_is_intel_lpt_switchable_xhci(struct pci_dev *pdev)
+{
+       return pdev->class == PCI_CLASS_SERIAL_USB_XHCI &&
+               pdev->vendor == PCI_VENDOR_ID_INTEL &&
+               pdev->device == PCI_DEVICE_ID_INTEL_LYNX_POINT_XHCI;
+}
+
+bool usb_is_intel_switchable_xhci(struct pci_dev *pdev)
+{
+       return usb_is_intel_ppt_switchable_xhci(pdev) ||
+               usb_is_intel_lpt_switchable_xhci(pdev);
+}
 EXPORT_SYMBOL_GPL(usb_is_intel_switchable_xhci);
 
 /*
@@ -742,6 +759,19 @@ void usb_enable_xhci_ports(struct pci_dev *xhci_pdev)
 {
        u32             ports_available;
 
+       /* Don't switchover the ports if the user hasn't compiled the xHCI
+        * driver.  Otherwise they will see "dead" USB ports that don't power
+        * the devices.
+        */
+       if (!IS_ENABLED(CONFIG_USB_XHCI_HCD)) {
+               dev_warn(&xhci_pdev->dev,
+                               "CONFIG_USB_XHCI_HCD is turned off, "
+                               "defaulting to EHCI.\n");
+               dev_warn(&xhci_pdev->dev,
+                               "USB 3.0 devices will work at USB 2.0 speeds.\n");
+               return;
+       }
+
        ports_available = 0xffffffff;
        /* Write USB3_PSSEN, the USB 3.0 Port SuperSpeed Enable
         * Register, to turn on SuperSpeed terminations for all
This page took 0.029874 seconds and 5 git commands to generate.