Except SDHCI_QUIRK_BROKEN_CARD_DETECTION and MMC_CAP_NONREMOVABLE,
we also do not need to handle controller native card detect interrupt
for gpio as card detect case.
If we wrong enabled the card detect interrupt for gpio case,
it will cause a lot of unexpected card detect interrupts during data transfer
which should not happen.
Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit
2bf47f78bee173798e6d6f360b12defd945c936c)
Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
Conflicts:
drivers/mmc/host/sdhci.c
static void sdhci_set_card_detection(struct sdhci_host *host, bool enable)
{
u32 present;
+ int gpio_cd = mmc_gpio_get_cd(host->mmc);
if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) ||
- !mmc_card_is_removable(host->mmc))
+ !mmc_card_is_removable(host->mmc) || !IS_ERR_VALUE(gpio_cd))
return;
if (enable) {