From patchwork Wed Aug 22 04:05:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 1359121 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EA0EB3FC71 for ; Wed, 22 Aug 2012 04:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751522Ab2HVENw (ORCPT ); Wed, 22 Aug 2012 00:13:52 -0400 Received: from mail-wg0-f74.google.com ([74.125.82.74]:53354 "EHLO mail-wg0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750825Ab2HVENv (ORCPT ); Wed, 22 Aug 2012 00:13:51 -0400 Received: by wgbdt11 with SMTP id dt11so20558wgb.1 for ; Tue, 21 Aug 2012 21:13:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=5l2orKuWrgPPIJola06NFh+78D5ysWmzRv1jFAvTlic=; b=XMQ/NPy/P+DYybyJgDfqf68R6ZfH3S1FdiBscC16K1Y2GOD5mrHtFL4wmQBPzNMT6E VFriFCzkFA56qCR/v07Zt1PPbxxjWwamHutH3e0yYaLXiQE/ucXyEP6hK/rbEH0wyfzs FmOGH5/T+o/l5nBRx18+hnpfWDGcp9dhPzhF9VDJc8QKo9vp9VsA5zNOaqf1vxdVJ03c GysyMVl1qSDzZ/wJraogT8/FIul++O0xIJme2Dhh4382MYgpr96L2W/ZQ5N5JaT02aKz viZD55Y6nQMjRkdfmfYQFHFOWctERR2W1PCilOFkMa9KdxThjfNLHOA6SbWX3GM85lAP dHAA== Received: by 10.180.98.234 with SMTP id el10mr140924wib.3.1345608351740; Tue, 21 Aug 2012 21:05:51 -0700 (PDT) Received: by 10.180.98.234 with SMTP id el10mr140902wib.3.1345608351674; Tue, 21 Aug 2012 21:05:51 -0700 (PDT) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id cd1si744950wib.1.2012.08.21.21.05.51 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 21 Aug 2012 21:05:51 -0700 (PDT) Received: from peppermint.mtv.corp.google.com (peppermint.mtv.corp.google.com [172.22.162.25]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 4810820004E; Tue, 21 Aug 2012 21:05:51 -0700 (PDT) Received: by peppermint.mtv.corp.google.com (Postfix, from userid 121310) id 862EB19AA62; Tue, 21 Aug 2012 21:05:50 -0700 (PDT) From: Doug Anderson To: linux-mmc@vger.kernel.org Cc: Olof Johansson , Alim Akhtar , Thomas P Abraham , Chris Ball , Will Newton , Seungwon Jeon , Jaehoon Chung , James Hogan , linux-kernel@vger.kernel.org, Linus Walleij , Ulf Hansson , Adrian Hunter , Doug Anderson Subject: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards Date: Tue, 21 Aug 2012 21:05:17 -0700 Message-Id: <1345608318-15347-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 1.7.7.3 X-Gm-Message-State: ALoCoQn/tmHvr7Q07F3nne+zm+Lghdzvd29NzvoBxPC6FpcQIVbwdJJrf8bzJhsfOWkZj4KMJM9NQihziCpADVr5RG8ZDxiIRvVbzIzrqKD9QXLwjWlbpyld4MD35u7CywK96B/YSmQLgUUSzzvBIboKRSNoxbEL++mtNJ25TKYYLYcDaghM7nD6J5MAPWhXeF15uArElnrHhGFFm6e8XYwqYeu/Ya5h5Q== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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. Signed-off-by: Doug Anderson Signed-off-by: Alim Akhtar --- drivers/mmc/core/core.c | 2 +- include/linux/mmc/host.h | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 8ac5246..3214972 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1981,7 +1981,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 f578a71..f36370e 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -257,6 +257,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 << 12) /* Only SD supported, not MMC */ mmc_pm_flag_t pm_caps; /* supported pm features */ unsigned int power_notify_type;