From patchwork Tue May 14 08:09:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Lee X-Patchwork-Id: 243621 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 411142C00B5 for ; Tue, 14 May 2013 18:09:33 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UcAIJ-0005oO-H4; Tue, 14 May 2013 08:09:11 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UcAHy-0005mq-CP for kernel-team@lists.ubuntu.com; Tue, 14 May 2013 08:08:50 +0000 Received: from [116.213.97.190] (helo=adam-laptop.ipsec11.blockcn.net) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1UcAHx-0000Xb-M5; Tue, 14 May 2013 08:08:50 +0000 From: Adam Lee To: kernel-team@lists.ubuntu.com Subject: [Raring][PATCH] UBUNTU: SAUCE: mmc: core: Add a capability for disabling mmc cards Date: Tue, 14 May 2013 16:09:30 +0800 Message-Id: <1368518971-1330-2-git-send-email-adam.lee@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1368518971-1330-1-git-send-email-adam.lee@canonical.com> References: <1368518971-1330-1-git-send-email-adam.lee@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com 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 Signed-off-by: Alim Akhtar Signed-off-by: Adam Lee --- 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 */