PCI: Add PCI_CLASS_SERIAL_USB_DEVICE definition
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Tue, 15 Mar 2016 12:06:00 +0000 (14:06 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 15 Mar 2016 13:52:28 +0000 (08:52 -0500)
PCI-SIG has defined Interface FEh for Base Class 0Ch, Sub-Class 03h as "USB
Device (not host controller)".  It is already being used in various USB
device controller drivers for matching, so add PCI_CLASS_SERIAL_USB_DEVICE
and use it.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/quirks.c
drivers/usb/gadget/udc/amd5536udc.c
drivers/usb/gadget/udc/goku_udc.c
drivers/usb/gadget/udc/net2280.c
drivers/usb/gadget/udc/pch_udc.c
include/linux/pci_ids.h

index 0575a1e026b4c4550ee07655910cc64d0e0e9341..5714fcfde302bcf1d38734f87d174295dad0433f 100644 (file)
@@ -438,7 +438,7 @@ static void quirk_amd_nl_class(struct pci_dev *pdev)
        u32 class = pdev->class;
 
        /* Use "USB Device (not host controller)" class */
-       pdev->class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe;
+       pdev->class = PCI_CLASS_SERIAL_USB_DEVICE;
        dev_info(&pdev->dev, "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhci\n",
                 class, pdev->class);
 }
index cd8764150861cf1c677bb25a52f4a1b00294b52e..39d70b4a89581620d329444af1af61367d8b40ea 100644 (file)
@@ -3397,7 +3397,7 @@ err_pcidev:
 static const struct pci_device_id pci_id[] = {
        {
                PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x2096),
-               .class =        (PCI_CLASS_SERIAL_USB << 8) | 0xfe,
+               .class =        PCI_CLASS_SERIAL_USB_DEVICE,
                .class_mask =   0xffffffff,
        },
        {},
index 1fdfec14a3ba13eea57dfced8b170752e452fdb2..d2205d9e0c8b43265901352548342b0e8646ca97 100644 (file)
@@ -1846,7 +1846,7 @@ err:
 /*-------------------------------------------------------------------------*/
 
 static const struct pci_device_id pci_ids[] = { {
-       .class =        ((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
+       .class =        PCI_CLASS_SERIAL_USB_DEVICE,
        .class_mask =   ~0,
        .vendor =       0x102f,         /* Toshiba */
        .device =       0x0107,         /* this UDC */
index 6706aef907f4bdb32b308f148612a2566c2eb3b9..c894b94b234bf58aba86cea8a341abb88941e61a 100644 (file)
@@ -3735,7 +3735,7 @@ static void net2280_shutdown(struct pci_dev *pdev)
 /*-------------------------------------------------------------------------*/
 
 static const struct pci_device_id pci_ids[] = { {
-       .class =        ((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
+       .class =        PCI_CLASS_SERIAL_USB_DEVICE,
        .class_mask =   ~0,
        .vendor =       PCI_VENDOR_ID_PLX_LEGACY,
        .device =       0x2280,
@@ -3743,7 +3743,7 @@ static const struct pci_device_id pci_ids[] = { {
        .subdevice =    PCI_ANY_ID,
        .driver_data =  PLX_LEGACY | PLX_2280,
        }, {
-       .class =        ((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
+       .class =        PCI_CLASS_SERIAL_USB_DEVICE,
        .class_mask =   ~0,
        .vendor =       PCI_VENDOR_ID_PLX_LEGACY,
        .device =       0x2282,
@@ -3752,7 +3752,7 @@ static const struct pci_device_id pci_ids[] = { {
        .driver_data =  PLX_LEGACY,
        },
        {
-       .class =        ((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
+       .class =        PCI_CLASS_SERIAL_USB_DEVICE,
        .class_mask =   ~0,
        .vendor =       PCI_VENDOR_ID_PLX,
        .device =       0x3380,
@@ -3761,7 +3761,7 @@ static const struct pci_device_id pci_ids[] = { {
        .driver_data =  PLX_SUPERSPEED,
         },
        {
-       .class =        ((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
+       .class =        PCI_CLASS_SERIAL_USB_DEVICE,
        .class_mask =   ~0,
        .vendor =       PCI_VENDOR_ID_PLX,
        .device =       0x3382,
index 7a04157ff5796883f8c9ec3835b43c16155fbc3d..9571ef54b86b53fcda4ba6517ed75e02f1751abb 100644 (file)
@@ -3234,22 +3234,22 @@ static const struct pci_device_id pch_udc_pcidev_id[] = {
        {
                PCI_DEVICE(PCI_VENDOR_ID_INTEL,
                           PCI_DEVICE_ID_INTEL_QUARK_X1000_UDC),
-               .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe,
+               .class = PCI_CLASS_SERIAL_USB_DEVICE,
                .class_mask = 0xffffffff,
        },
        {
                PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EG20T_UDC),
-               .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe,
+               .class = PCI_CLASS_SERIAL_USB_DEVICE,
                .class_mask = 0xffffffff,
        },
        {
                PCI_DEVICE(PCI_VENDOR_ID_ROHM, PCI_DEVICE_ID_ML7213_IOH_UDC),
-               .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe,
+               .class = PCI_CLASS_SERIAL_USB_DEVICE,
                .class_mask = 0xffffffff,
        },
        {
                PCI_DEVICE(PCI_VENDOR_ID_ROHM, PCI_DEVICE_ID_ML7831_IOH_UDC),
-               .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe,
+               .class = PCI_CLASS_SERIAL_USB_DEVICE,
                .class_mask = 0xffffffff,
        },
        { 0 },
index 6d249d32c8b8f243c1bac33a4e4f59f0822facee..247da8c9586073d6759d333051909c5c4d050315 100644 (file)
 #define PCI_CLASS_SERIAL_USB_OHCI      0x0c0310
 #define PCI_CLASS_SERIAL_USB_EHCI      0x0c0320
 #define PCI_CLASS_SERIAL_USB_XHCI      0x0c0330
+#define PCI_CLASS_SERIAL_USB_DEVICE    0x0c03fe
 #define PCI_CLASS_SERIAL_FIBER         0x0c04
 #define PCI_CLASS_SERIAL_SMBUS         0x0c05