From: Jaehoon Chung <jh80.chung@samsung.com>
To: Doug Anderson <dianders@chromium.org>
Cc: linux-mmc@vger.kernel.org, Olof Johansson <olof@lixom.net>,
Alim Akhtar <alim.akhtar@samsung.com>,
Thomas P Abraham <thomas.ab@samsung.com>,
Chris Ball <cjb@laptop.org>, Will Newton <will.newton@imgtec.com>,
Seungwon Jeon <tgih.jun@samsung.com>,
Jaehoon Chung <jh80.chung@samsung.com>,
James Hogan <james.hogan@imgtec.com>,
linux-kernel@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards
Date: Wed, 22 Aug 2012 13:35:13 +0900 [thread overview]
Message-ID: <50346181.3010406@samsung.com> (raw)
In-Reply-To: <1345608318-15347-1-git-send-email-dianders@chromium.org>
Hi Doug,
I didn't know what purpose is.
Why need to add the MMC_CAP2_NO_MMC?
If card is SD or SDIO, mmc_attach_mmc(host) should not be entered.
Could you explain to me in more detail?
Best Regards,
Jaehoon Chung
On 08/22/2012 01:05 PM, Doug Anderson wrote:
> 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 <dianders@chromium.org>
> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> ---
> 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;
>
next prev parent reply other threads:[~2012-08-22 4:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 4:05 [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards Doug Anderson
2012-08-22 4:05 ` [PATCH 2/2] mmc: dw_mmc: Add a DISABLE_MMC quirk that sets the core mmc cap Doug Anderson
2012-08-22 4:35 ` Jaehoon Chung [this message]
2012-08-22 15:44 ` [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards Doug Anderson
2012-08-22 16:00 ` Philip Rakity
2012-08-22 16:50 ` Olof Johansson
2012-08-22 18:25 ` Nicolas Pitre
2012-08-22 18:27 ` Olof Johansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50346181.3010406@samsung.com \
--to=jh80.chung@samsung.com \
--cc=adrian.hunter@intel.com \
--cc=alim.akhtar@samsung.com \
--cc=cjb@laptop.org \
--cc=dianders@chromium.org \
--cc=james.hogan@imgtec.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=olof@lixom.net \
--cc=tgih.jun@samsung.com \
--cc=thomas.ab@samsung.com \
--cc=ulf.hansson@linaro.org \
--cc=will.newton@imgtec.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox