]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00295184-1 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@freescale.com>
Fri, 16 Jan 2015 03:18:01 +0000 (21:18 -0600)
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)

drivers/mmc/host/sdhci.c

index f7ea741232d9b1f9559035bb5cde7207c65fcdd5..a355ed1e26147a34d56776286ef4254411e1f0a3 100644 (file)
@@ -155,9 +155,11 @@ static void sdhci_mask_irqs(struct sdhci_host *host, u32 irqs)
 static void sdhci_set_card_detection(struct sdhci_host *host, bool enable)
 {
        u32 present, irqs;
+       int gpio_cd = mmc_gpio_get_cd(host->mmc);
 
        if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) ||
-           (host->mmc->caps & MMC_CAP_NONREMOVABLE))
+           (host->mmc->caps & MMC_CAP_NONREMOVABLE) ||
+           !IS_ERR_VALUE(gpio_cd))
                return;
 
        present = sdhci_readl(host, SDHCI_PRESENT_STATE) &