USB: Add hub descriptor update hook for xHCI
[sfrench/cifs-2.6.git] / drivers / usb / host / xhci-pci.c
index 592fe7e623f7a0d8f863a5d72a67dae42c4ea7aa..06595ec27bb71af11cd4524c316070c61da1f2d0 100644 (file)
 
 #include "xhci.h"
 
+/* Device for a quirk */
+#define PCI_VENDOR_ID_FRESCO_LOGIC     0x1b73
+#define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000
+
 static const char hcd_name[] = "xhci_hcd";
 
 /* called after powerup, by probe or system-pm "wakeup" */
@@ -59,9 +63,20 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
        xhci->hcs_params1 = xhci_readl(xhci, &xhci->cap_regs->hcs_params1);
        xhci->hcs_params2 = xhci_readl(xhci, &xhci->cap_regs->hcs_params2);
        xhci->hcs_params3 = xhci_readl(xhci, &xhci->cap_regs->hcs_params3);
+       xhci->hcc_params = xhci_readl(xhci, &xhci->cap_regs->hc_capbase);
+       xhci->hci_version = HC_VERSION(xhci->hcc_params);
        xhci->hcc_params = xhci_readl(xhci, &xhci->cap_regs->hcc_params);
        xhci_print_registers(xhci);
 
+       /* Look for vendor-specific quirks */
+       if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
+                       pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
+                       pdev->revision == 0x0) {
+                       xhci->quirks |= XHCI_RESET_EP_QUIRK;
+                       xhci_dbg(xhci, "QUIRK: Fresco Logic xHC needs configure"
+                                       " endpoint cmd after reset endpoint\n");
+       }
+
        /* Make sure the HC is halted. */
        retval = xhci_halt(xhci);
        if (retval)
@@ -121,6 +136,7 @@ static const struct hc_driver xhci_pci_hc_driver = {
        .check_bandwidth =      xhci_check_bandwidth,
        .reset_bandwidth =      xhci_reset_bandwidth,
        .address_device =       xhci_address_device,
+       .update_hub_device =    xhci_update_hub_device,
 
        /*
         * scheduling support