From ec739d48ef1707bb3524e22813d9cad6ef8c1679 Mon Sep 17 00:00:00 2001 From: Dong Aisheng Date: Tue, 31 Dec 2013 16:22:44 +0800 Subject: [PATCH] MLK-11685-3 mmc: sdhci: do not enable card detect interrupt for gpio cd type 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 (cherry picked from commit 2bf47f78bee173798e6d6f360b12defd945c936c) Signed-off-by: Haibo Chen Conflicts: drivers/mmc/host/sdhci.c --- drivers/mmc/host/sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 7d275e72903a..890e37a85b97 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -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) { -- 2.17.1