[Raring][PATCH] UBUNTU: SAUCE: mmc: core: Add a capability for disabling mmc cards
Adam Lee
adam.lee at canonical.com
Tue May 14 08:09:30 UTC 2013
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 at chromium.org>
Signed-off-by: Alim Akhtar <alim.akhtar at samsung.com>
Signed-off-by: Adam Lee <adam.lee at canonical.com>
---
drivers/mmc/core/core.c | 2 +-
include/linux/mmc/host.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index aaed768..393fd07 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2091,7 +2091,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 61a10c1..949f788 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -258,6 +258,7 @@ struct mmc_host {
#define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */
#define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */
#define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */
+#define MMC_CAP2_NO_MMC (1 << 15) /* Only SD supported, not MMC */
mmc_pm_flag_t pm_caps; /* supported pm features */
--
1.7.10.4
More information about the kernel-team
mailing list