usb: dwc3: haps: Workaround matching VID PID
authorThinh Nguyen <thinh.nguyen@synopsys.com>
Wed, 6 Feb 2019 18:49:26 +0000 (10:49 -0800)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 7 Feb 2019 11:17:19 +0000 (13:17 +0200)
i.MX6QP and i.MX7D platform use a PCIe controller with the same VID and
PID as this USB controller. The system may incorrectly match this driver
to that PCIe controller. To workaround this, specifically use class type
USB with PCI device ID to prevent incorrect driver matching.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/dwc3-haps.c

index 02d57d98ef9bd41190257a9d05ca028cb07c0fd1..3cecbf1694526eed989ccbd0b39d2988d2697564 100644 (file)
@@ -106,6 +106,15 @@ static const struct pci_device_id dwc3_haps_id_table[] = {
        {
                PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS,
                           PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3),
+               /*
+                * i.MX6QP and i.MX7D platform use a PCIe controller with the
+                * same VID and PID as this USB controller. The system may
+                * incorrectly match this driver to that PCIe controller. To
+                * workaround this, specifically use class type USB to prevent
+                * incorrect driver matching.
+                */
+               .class = (PCI_CLASS_SERIAL_USB << 8),
+               .class_mask = 0xffff00,
        },
        {
                PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS,