mmc: core: Add a capability for disabling mmc cards
authorDoug Anderson <dianders@chromium.org>
Tue, 21 Aug 2012 19:42:44 +0000 (12:42 -0700)
committerGerrit <chrome-bot@google.com>
Tue, 21 Aug 2012 23:40:50 +0000 (16:40 -0700)
On some systems we need a way to disable MMC card support in a MMC/SD
card slot.  Add support in the core SD/MMC code to support this.

BUG=chrome-os-partner:11811
TEST=With patch series, plug in an MMC card and saw that it was
detected before this patch but isn't detected after.

Change-Id: I5b94a1d7deba85e0eb4709a419589cc3e9058eca
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/31021

drivers/mmc/core/core.c
include/linux/mmc/host.h

index ac85ac1..148d27a 100644 (file)
@@ -1941,7 +1941,7 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
                return 0;
        if (!mmc_attach_sd(host))
                return 0;
-       if (!mmc_attach_mmc(host))
+       if (!(host->caps2 & MMC_CAP2_NO_MMC) && !mmc_attach_mmc(host))
                return 0;
 
        mmc_power_off(host);
index 0707d22..89fbeb4 100644 (file)
@@ -238,6 +238,7 @@ struct mmc_host {
 #define MMC_CAP2_BROKEN_VOLTAGE        (1 << 7)        /* Use the broken voltage */
 #define MMC_CAP2_DETECT_ON_ERR (1 << 8)        /* On I/O err check card removal */
 #define MMC_CAP2_HC_ERASE_SZ   (1 << 9)        /* High-capacity erase size */
+#define MMC_CAP2_NO_MMC                (1 << 10)       /* Only SD supported, not MMC */
 
        mmc_pm_flag_t           pm_caps;        /* supported pm features */
        unsigned int        power_notify_type;