]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
PCI: Add QEMU top-level IDs for (sub)vendor & device
authorRobin H. Johnson <robbat2@gentoo.org>
Sun, 6 Mar 2016 22:02:30 +0000 (22:02 +0000)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 9 Mar 2016 04:31:21 +0000 (22:31 -0600)
Introduce PCI_VENDOR/PCI_SUBVENDOR/PCI_SUBDEVICE defines to replace the
constants scattered in the kernel already used to detect QEMU.

They are defined in the QEMU codebase per docs/specs/pci-ids.txt.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/bochs/bochs_drv.c
drivers/gpu/drm/cirrus/cirrus_drv.c
drivers/virtio/virtio_pci_common.c
include/linux/pci_ids.h
sound/pci/intel8x0.c

index 7f1a3604b19f60295ded6b684159981c651ca322..b332b4d3b0e284463447519924ecfe08086615ef 100644 (file)
@@ -182,8 +182,8 @@ static const struct pci_device_id bochs_pci_tbl[] = {
        {
                .vendor      = 0x1234,
                .device      = 0x1111,
-               .subvendor   = 0x1af4,
-               .subdevice   = 0x1100,
+               .subvendor   = PCI_SUBVENDOR_ID_REDHAT_QUMRANET,
+               .subdevice   = PCI_SUBDEVICE_ID_QEMU,
                .driver_data = BOCHS_QEMU_STDVGA,
        },
        {
index b1619e29a564db97ef626fd2c32bceaa3a18cadc..7bc394ec9fb3af7985ab746eeb3b9f1d020a852e 100644 (file)
@@ -33,8 +33,9 @@ static struct drm_driver driver;
 
 /* only bind to the cirrus chip in qemu */
 static const struct pci_device_id pciidlist[] = {
-       { PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, 0x1af4, 0x1100, 0,
-         0, 0 },
+       { PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446,
+         PCI_SUBVENDOR_ID_REDHAT_QUMRANET, PCI_SUBDEVICE_ID_QEMU,
+         0, 0, 0 },
        { PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, PCI_VENDOR_ID_XEN,
          0x0001, 0, 0, 0 },
        {0,}
index 36205c27c4d0f19ab61a4aa4175de3dd8785de66..127dfe4e86942f15b9d54db2228345c3e4a16823 100644 (file)
@@ -467,7 +467,7 @@ static const struct dev_pm_ops virtio_pci_pm_ops = {
 
 /* Qumranet donated their vendor ID for devices 0x1000 thru 0x10FF. */
 static const struct pci_device_id virtio_pci_id_table[] = {
-       { PCI_DEVICE(0x1af4, PCI_ANY_ID) },
+       { PCI_DEVICE(PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_ANY_ID) },
        { 0 }
 };
 
index 37f05cb1dfd6d93cae1ceeffc8a3de1c0fcb0529..6d249d32c8b8f243c1bac33a4e4f59f0822facee 100644 (file)
 
 #define PCI_VENDOR_ID_AZWAVE           0x1a3b
 
+#define PCI_VENDOR_ID_REDHAT_QUMRANET    0x1af4
+#define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4
+#define PCI_SUBDEVICE_ID_QEMU            0x1100
+
 #define PCI_VENDOR_ID_ASMEDIA          0x1b21
 
 #define PCI_VENDOR_ID_CIRCUITCO                0x1cc8
index 42bcbac801a322d0f7cf8df6961e9c6129ae0093..12c2c180e4072755ba17a4826070093669b45723 100644 (file)
@@ -2980,8 +2980,8 @@ static int snd_intel8x0_inside_vm(struct pci_dev *pci)
                goto fini;
 
        /* check for known (emulated) devices */
-       if (pci->subsystem_vendor == 0x1af4 &&
-           pci->subsystem_device == 0x1100) {
+       if (pci->subsystem_vendor == PCI_SUBVENDOR_ID_REDHAT_QUMRANET &&
+           pci->subsystem_device == PCI_SUBDEVICE_ID_QEMU) {
                /* KVM emulated sound, PCI SSID: 1af4:1100 */
                msg = "enable KVM";
        } else if (pci->subsystem_vendor == 0x1ab8) {