Commit c949c907 authored by Matthias Kraemer's avatar Matthias Kraemer Committed by Ulf Hansson

mmc: sdhci-pci: Use macros in pci_ids definition

This patch applies customized PCI_DEVICE_ macros to specify the pci_ids
instead of open-coding them within the sdhci-pci driver.

By introducing device specific macros the pci_ids table becomes much
shorter and easier to comprehend than it would be possible using the
generic version of the PCI_DEVICE_ macros.
Signed-off-by: default avatarMatthias Kraemer <matthiasmartinsson@gmail.com>
Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 667123f6
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define __SDHCI_PCI_H #define __SDHCI_PCI_H
/* /*
* PCI device IDs * PCI device IDs, sub IDs
*/ */
#define PCI_DEVICE_ID_INTEL_PCH_SDIO0 0x8809 #define PCI_DEVICE_ID_INTEL_PCH_SDIO0 0x8809
...@@ -38,6 +38,47 @@ ...@@ -38,6 +38,47 @@
#define PCI_DEVICE_ID_INTEL_GLK_EMMC 0x31cc #define PCI_DEVICE_ID_INTEL_GLK_EMMC 0x31cc
#define PCI_DEVICE_ID_INTEL_GLK_SDIO 0x31d0 #define PCI_DEVICE_ID_INTEL_GLK_SDIO 0x31d0
#define PCI_DEVICE_ID_SYSKONNECT_8000 0x8000
#define PCI_DEVICE_ID_VIA_95D0 0x95d0
#define PCI_DEVICE_ID_REALTEK_5250 0x5250
#define PCI_SUBDEVICE_ID_NI_7884 0x7884
/*
* PCI device class and mask
*/
#define SYSTEM_SDHCI (PCI_CLASS_SYSTEM_SDHCI << 8)
#define PCI_CLASS_MASK 0xFFFF00
/*
* Macros for PCI device-description
*/
#define _PCI_VEND(vend) PCI_VENDOR_ID_##vend
#define _PCI_DEV(vend, dev) PCI_DEVICE_ID_##vend##_##dev
#define _PCI_SUBDEV(subvend, subdev) PCI_SUBDEVICE_ID_##subvend##_##subdev
#define SDHCI_PCI_DEVICE(vend, dev, cfg) { \
.vendor = _PCI_VEND(vend), .device = _PCI_DEV(vend, dev), \
.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, \
.driver_data = (kernel_ulong_t)&(sdhci_##cfg) \
}
#define SDHCI_PCI_SUBDEVICE(vend, dev, subvend, subdev, cfg) { \
.vendor = _PCI_VEND(vend), .device = _PCI_DEV(vend, dev), \
.subvendor = _PCI_VEND(subvend), \
.subdevice = _PCI_SUBDEV(subvend, subdev), \
.driver_data = (kernel_ulong_t)&(sdhci_##cfg) \
}
#define SDHCI_PCI_DEVICE_CLASS(vend, cl, cl_msk, cfg) { \
.vendor = _PCI_VEND(vend), .device = PCI_ANY_ID, \
.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, \
.class = (cl), .class_mask = (cl_msk), \
.driver_data = (kernel_ulong_t)&(sdhci_##cfg) \
}
/* /*
* PCI registers * PCI registers
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment