From: Jerry Huang <[email protected]>

The current eSDHC driver use the poll mode to detect
if the SD/MMC card is inserted or removed, which will generate
many interrupts and impact the performance. 
Therefore, change the default card detect to interrupt mode,
if the board can't support this mode, we still use the poll mode.

Signed-off-by: Jerry Huang <[email protected]>
CC: Anton Vorontsov <[email protected]>
CC: Chris Ball <[email protected]>
---
 drivers/mmc/host/sdhci-of-esdhc.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-of-esdhc.c 
b/drivers/mmc/host/sdhci-of-esdhc.c
index ffc1226..5dc362f 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -196,6 +196,11 @@ static void esdhc_of_detect_limitation(struct 
platform_device *pdev,
        if (vvn == VENDOR_V_22)
                pdata->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
 
+       /* P4080DS and MPC837XMDS board don't support interrupt mode */
+       if (of_machine_is_compatible("fsl,mpc837xmds") ||
+           of_machine_is_compatible("fsl,P4080DS"))
+               pdata->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+
        iounmap(ioaddr);
 end:
        return;
@@ -223,7 +228,7 @@ static struct sdhci_pltfm_data sdhci_esdhc_pdata = {
         * card detection could be handled via GPIO
         * eSDHC cannot support End Attribute in NOP ADMA descriptor
         */
-       .quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_BROKEN_CARD_DETECTION
+       .quirks = ESDHC_DEFAULT_QUIRKS
                | SDHCI_QUIRK_NO_CARD_NO_RESET
                | SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
        .ops = &sdhci_esdhc_ops,
-- 
1.7.9.5


--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to