From patchwork Tue May 14 08:40:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Lee X-Patchwork-Id: 243628 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 9A9672C00AE for ; Tue, 14 May 2013 18:40:05 +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 1UcAm0-0001db-Ii; Tue, 14 May 2013 08:39:52 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UcAlv-0001dW-CG for kernel-team@lists.ubuntu.com; Tue, 14 May 2013 08:39:47 +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 1UcAlu-0001iR-Ll; Tue, 14 May 2013 08:39:47 +0000 From: Adam Lee To: kernel-team@lists.ubuntu.com Subject: [Precise][PATCH] UBUNTU: SAUCE: mmc: core: Add a capability for disabling mmc cards Date: Tue, 14 May 2013 16:40:31 +0800 Message-Id: <1368520831-7671-1-git-send-email-adam.lee@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1368518971-1330-3-git-send-email-adam.lee@canonical.com> References: <1368518971-1330-3-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 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;