summaryrefslogtreecommitdiff
path: root/drivers/mmc/core/card.h
diff options
context:
space:
mode:
authorH. Nikolaus Schaller <hns@goldelico.com>2021-11-10 20:17:08 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2021-12-14 23:35:23 +0300
commit818cd40529d9f19aa7ca3794f73477b5ac3ef350 (patch)
treed456ff93fafe42ff4cef46b355a04c019e83e809 /drivers/mmc/core/card.h
parentb360b11026705369f7ea51653f75dbe611322338 (diff)
downloadlinux-818cd40529d9f19aa7ca3794f73477b5ac3ef350.tar.xz
mmc: core: provide macro and table to match the device tree to apply quirks
This (initially empty) table allows to match quirks early based on .compatible of the child node of some mmc/sdio interface. This allows to add quirks based on device tree instead of having card specific code in the host ops. A new macro SDIO_FIXUP_COMPATIBLE makes the definition readable. And we call mmc_fixup_device(sdio_card_init_methods) just after where host->ops->init_card() can be optionally called. Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com> Link: https://lore.kernel.org/r/b13fd8b3eebc3c23b6816b254a518c224cbdcfd4.1636564631.git.hns@goldelico.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/card.h')
-rw-r--r--drivers/mmc/core/card.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mmc/core/card.h b/drivers/mmc/core/card.h
index 483e7f2f1039..216faf5ad102 100644
--- a/drivers/mmc/core/card.h
+++ b/drivers/mmc/core/card.h
@@ -122,6 +122,21 @@ struct mmc_fixup {
_vendor, _device, \
_fixup, _data, EXT_CSD_REV_ANY) \
+#define SDIO_FIXUP_COMPATIBLE(_compatible, _fixup, _data) \
+ { \
+ .name = CID_NAME_ANY, \
+ .manfid = CID_MANFID_ANY, \
+ .oemid = CID_OEMID_ANY, \
+ .rev_start = 0, \
+ .rev_end = -1ull, \
+ .cis_vendor = SDIO_ANY_ID, \
+ .cis_device = SDIO_ANY_ID, \
+ .vendor_fixup = (_fixup), \
+ .data = (_data), \
+ .ext_csd_rev = EXT_CSD_REV_ANY, \
+ .of_compatible = _compatible, \
+ }
+
#define cid_rev(hwrev, fwrev, year, month) \
(((u64) hwrev) << 40 | \
((u64) fwrev) << 32 | \