]> git.sur5r.net Git - u-boot/commitdiff
mmc: Poll for broken card detection case
authorJun Nie <jun.nie@linaro.org>
Tue, 2 Jan 2018 04:25:57 +0000 (12:25 +0800)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 24 Jan 2018 07:12:03 +0000 (16:12 +0900)
Poll for broken card detection case instead of return
no card detected.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
drivers/mmc/Kconfig
drivers/mmc/mmc.c

index ab0627a8afb120035cf16053b76d42f780973541..bc29611d783be4788777ef70e7ed14cbe1c8004b 100644 (file)
@@ -17,6 +17,11 @@ config MMC_WRITE
        help
          Enable write access to MMC and SD Cards
 
+config MMC_BROKEN_CD
+       bool "Poll for broken card detection case"
+       help
+         If card  detection feature is broken, just poll to detect.
+
 config DM_MMC
        bool "Enable MMC controllers using Driver Model"
        depends on DM
index 2d0e7bb3a27cdc3dace9381c7ab8bd1f34ff19f9..255310a8e619c1e229f883a25c07455b872e19d7 100644 (file)
@@ -2493,8 +2493,12 @@ int mmc_start_init(struct mmc *mmc)
        mmc->host_caps = mmc->cfg->host_caps | MMC_CAP(SD_LEGACY) |
                         MMC_CAP(MMC_LEGACY) | MMC_MODE_1BIT;
 
+#if !defined(CONFIG_MMC_BROKEN_CD)
        /* we pretend there's no card when init is NULL */
        no_card = mmc_getcd(mmc) == 0;
+#else
+       no_card = 0;
+#endif
 #if !CONFIG_IS_ENABLED(DM_MMC)
        no_card = no_card || (mmc->cfg->ops->init == NULL);
 #endif