diff mbox

[Precise] UBUNTU: SAUCE: mmc: core: Add a capability for disabling mmc cards

Message ID 1368520831-7671-1-git-send-email-adam.lee@canonical.com
State New
Headers show

Commit Message

Adam Lee May 14, 2013, 8:40 a.m. UTC
On some systems we need a way to disable MMC card support in a MMC/SD
card slot due to the legal concern.

Add support in the core SD/MMC code to support this.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Adam Lee <adam.lee@canonical.com>
---
 drivers/mmc/core/core.c  |    2 +-
 include/linux/mmc/host.h |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 411a994..921b52f 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2045,7 +2045,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);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index deb6282..0b2d842 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -242,6 +242,7 @@  struct mmc_host {
 #define MMC_CAP2_CACHE_CTRL	(1 << 1)	/* Allow cache control */
 #define MMC_CAP2_POWEROFF_NOTIFY (1 << 2)	/* Notify poweroff supported */
 #define MMC_CAP2_NO_MULTI_READ	(1 << 3)	/* Multiblock reads don't work */
+#define MMC_CAP2_NO_MMC		(1 << 15)	/* Only SD supported, not MMC */
 
 	mmc_pm_flag_t		pm_caps;	/* supported pm features */
 	unsigned int        power_notify_type;