From: Chris Ball <cjb@laptop.org>
To: Ido Yariv <ido@wizery.com>
Cc: Sekhar Nori <nsekhar@ti.com>,
davinci-linux-open-source@linux.davincidsp.com,
linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org
Subject: Re: [PATCH REPOST v2] mmc: davinci: Add support for set_power callback
Date: Thu, 28 Jul 2011 18:02:04 -0400 [thread overview]
Message-ID: <m2y5zijc83.fsf@bob.laptop.org> (raw)
In-Reply-To: <1311886149-3009-1-git-send-email-ido@wizery.com> (Ido Yariv's message of "Thu, 28 Jul 2011 23:49:09 +0300")
Hi,
On Thu, Jul 28 2011, Ido Yariv wrote:
> Some devices connected to the MMC bus are power controlled by external
> means. For instance, an SDIO device may be powered down/up by an
> external gpio line.
>
> In order to avoid toggling power from within the MMC host driver, add a
> set_power callback function, which will be called by set_ios upon
> powering down/up.
>
> Signed-off-by: Ido Yariv <ido@wizery.com>
Acked-by: Chris Ball <cjb@laptop.org>
> CC: Chris Ball <cjb@laptop.org>
> ---
> arch/arm/mach-davinci/include/mach/mmc.h | 3 +++
> drivers/mmc/host/davinci_mmc.c | 13 +++++++++++++
> 2 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/include/mach/mmc.h b/arch/arm/mach-davinci/include/mach/mmc.h
> index d4f1e96..5ba6b22 100644
> --- a/arch/arm/mach-davinci/include/mach/mmc.h
> +++ b/arch/arm/mach-davinci/include/mach/mmc.h
> @@ -12,6 +12,9 @@ struct davinci_mmc_config {
> /* get_cd()/get_wp() may sleep */
> int (*get_cd)(int module);
> int (*get_ro)(int module);
> +
> + void (*set_power)(int module, bool on);
> +
> /* wires == 0 is equivalent to wires == 4 (4-bit parallel) */
> u8 wires;
>
> diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
> index 0076c74..64a8325 100644
> --- a/drivers/mmc/host/davinci_mmc.c
> +++ b/drivers/mmc/host/davinci_mmc.c
> @@ -807,12 +807,25 @@ static void calculate_clk_divider(struct mmc_host *mmc, struct mmc_ios *ios)
> static void mmc_davinci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> {
> struct mmc_davinci_host *host = mmc_priv(mmc);
> + struct platform_device *pdev = to_platform_device(mmc->parent);
> + struct davinci_mmc_config *config = pdev->dev.platform_data;
>
> dev_dbg(mmc_dev(host->mmc),
> "clock %dHz busmode %d powermode %d Vdd %04x\n",
> ios->clock, ios->bus_mode, ios->power_mode,
> ios->vdd);
>
> + switch (ios->power_mode) {
> + case MMC_POWER_OFF:
> + if (config && config->set_power)
> + config->set_power(pdev->id, false);
> + break;
> + case MMC_POWER_UP:
> + if (config && config->set_power)
> + config->set_power(pdev->id, true);
> + break;
> + }
> +
> switch (ios->bus_width) {
> case MMC_BUS_WIDTH_8:
> dev_dbg(mmc_dev(host->mmc), "Enabling 8 bit mode\n");
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
next prev parent reply other threads:[~2011-07-28 22:02 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-10 13:14 [PATCH v2 0/6] arm: davinci: DA850: wl12xx expansion card Ido Yariv
2011-07-10 13:14 ` [PATCH v2 1/6] arm: davinci: Fix low level gpio irq handlers' argument Ido Yariv
2011-07-11 11:58 ` Nori, Sekhar
2011-07-11 20:33 ` Ido Yariv
2011-07-11 21:03 ` [PATCH v3 " Ido Yariv
2011-07-12 9:22 ` Nori, Sekhar
2011-07-12 22:19 ` Ido Yariv
2011-07-10 13:14 ` [PATCH v2 2/6] arm: davinci: Explicitly set channel controllers' default queues Ido Yariv
2011-07-25 13:15 ` Nori, Sekhar
2011-07-25 13:33 ` Sergei Shtylyov
2011-07-25 16:31 ` Nori, Sekhar
2011-07-29 14:42 ` Ben Gardiner
2011-07-10 13:14 ` [PATCH v2 3/6] arm: davinci: mmc: Add support for set_power callback Ido Yariv
2011-07-25 13:19 ` Nori, Sekhar
2011-07-28 20:49 ` [PATCH REPOST v2] mmc: davinci: " Ido Yariv
2011-07-28 22:02 ` Chris Ball [this message]
2011-07-10 13:14 ` [PATCH v2 4/6] arm: davinci: DA850: Add MMC/SD1 pinmux configuration Ido Yariv
2011-07-10 13:14 ` [PATCH v2 5/6] arm: davinci: DA850: Add GPIO pinmux configuration for wl1271 Ido Yariv
2011-07-25 13:23 ` Nori, Sekhar
2011-07-10 13:14 ` [PATCH v2 6/6] arm: davinci: DA850: Add wl1271/wlan support Ido Yariv
2011-07-25 17:40 ` Nori, Sekhar
[not found] ` <B85A65D85D7EB246BE421B3FB0FBB593024DD2CEC2@dbde02.ent.ti.com>
2011-07-28 18:34 ` Ido Yariv
2011-08-22 7:37 ` Harishkumar V
2011-07-28 20:52 ` [PATCH v3] davinci: Add wl1271/wlan support for AM18x Ido Yariv
2011-07-28 21:15 ` Troy Kisky
2011-07-28 22:06 ` Ido Yariv
2011-07-29 18:51 ` Troy Kisky
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=m2y5zijc83.fsf@bob.laptop.org \
--to=cjb@laptop.org \
--cc=davinci-linux-open-source@linux.davincidsp.com \
--cc=ido@wizery.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=nsekhar@ti.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