mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-16 21:57:31 +07:00
1144c1e4dd
Rename mmc_fixup_methods to sdio_fixup_methods to better reflect that it's for sdio devices. So we could also pass on it from sdio card's probe sequence just like what we do for eMMC and block there. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
58 lines
1.7 KiB
C
58 lines
1.7 KiB
C
/*
|
|
* This file contains work-arounds for many known SD/MMC
|
|
* and SDIO hardware bugs.
|
|
*
|
|
* Copyright (c) 2011 Andrei Warkentin <andreiw@motorola.com>
|
|
* Copyright (c) 2011 Pierre Tardy <tardyp@gmail.com>
|
|
* Inspired from pci fixup code:
|
|
* Copyright (c) 1999 Martin Mares <mj@ucw.cz>
|
|
*
|
|
*/
|
|
|
|
#include <linux/mmc/sdio_ids.h>
|
|
|
|
#include "card.h"
|
|
|
|
static const struct mmc_fixup sdio_fixup_methods[] = {
|
|
SDIO_FIXUP(SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271,
|
|
add_quirk, MMC_QUIRK_NONSTD_FUNC_IF),
|
|
|
|
SDIO_FIXUP(SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271,
|
|
add_quirk, MMC_QUIRK_DISABLE_CD),
|
|
|
|
SDIO_FIXUP(SDIO_VENDOR_ID_STE, SDIO_DEVICE_ID_STE_CW1200,
|
|
add_quirk, MMC_QUIRK_BROKEN_BYTE_MODE_512),
|
|
|
|
SDIO_FIXUP(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_8797_F0,
|
|
add_quirk, MMC_QUIRK_BROKEN_IRQ_POLLING),
|
|
|
|
END_FIXUP
|
|
};
|
|
|
|
static inline void mmc_fixup_device(struct mmc_card *card,
|
|
const struct mmc_fixup *table)
|
|
{
|
|
const struct mmc_fixup *f;
|
|
u64 rev = cid_rev_card(card);
|
|
|
|
for (f = table; f->vendor_fixup; f++) {
|
|
if ((f->manfid == CID_MANFID_ANY ||
|
|
f->manfid == card->cid.manfid) &&
|
|
(f->oemid == CID_OEMID_ANY ||
|
|
f->oemid == card->cid.oemid) &&
|
|
(f->name == CID_NAME_ANY ||
|
|
!strncmp(f->name, card->cid.prod_name,
|
|
sizeof(card->cid.prod_name))) &&
|
|
(f->cis_vendor == card->cis.vendor ||
|
|
f->cis_vendor == (u16) SDIO_ANY_ID) &&
|
|
(f->cis_device == card->cis.device ||
|
|
f->cis_device == (u16) SDIO_ANY_ID) &&
|
|
(f->ext_csd_rev == EXT_CSD_REV_ANY ||
|
|
f->ext_csd_rev == card->ext_csd.rev) &&
|
|
rev >= f->rev_start && rev <= f->rev_end) {
|
|
dev_dbg(&card->dev, "calling %pf\n", f->vendor_fixup);
|
|
f->vendor_fixup(card, f->data);
|
|
}
|
|
}
|
|
}
|