MLK-11685-3 mmc: sdhci: do not enable card detect interrupt for gpio cd type
authorDong Aisheng <b29396@freescale.com>
Tue, 31 Dec 2013 08:22:44 +0000 (16:22 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:48:50 +0000 (14:48 -0500)
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

drivers/mmc/host/sdhci.c

index 7d275e7..890e37a 100644 (file)
@@ -117,9 +117,10 @@ static inline bool sdhci_data_line_cmd(struct mmc_command *cmd)
 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) {