linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.ml.walleij@gmail.com>
To: Rabin Vincent <rabin.vincent@stericsson.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org,
	STEricsson_nomadik_linux@list.st.com
Subject: Re: [PATCH 07/12] mmci: pass power_mode to the translate_vdd callback
Date: Wed, 23 Jun 2010 00:03:47 +0200	[thread overview]
Message-ID: <AANLkTil2Cb4alVFkfEjXApMgIdkmNvEEarWkT9AhXIdU@mail.gmail.com> (raw)
In-Reply-To: <1277198267-10860-7-git-send-email-rabin.vincent@stericsson.com>

Thinking a bit about this patch tonight:

2010/6/22 Rabin Vincent <rabin.vincent@stericsson.com>:

> Platforms may have some external power control which need to be
> controlled from board specific code.  This is the case for some versions
> of the MOP500 board (U8500 platform).
>
> Acked-by: Linus Walleij <linus.walleij@stericsson.com>
> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
> ---
>  drivers/mmc/host/mmci.c   |    3 ++-
>  include/linux/amba/mmci.h |    6 ++++--
>  2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index 322958f..63eb7f4 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -483,7 +483,8 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>                 * power control behind this translate function.
>                 */
>                if (!host->vcc && host->plat->translate_vdd)
> -                       pwr |= host->plat->translate_vdd(mmc_dev(mmc), ios->vdd);
> +                       pwr |= host->plat->translate_vdd(mmc_dev(mmc), ios->vdd,
> +                                                        ios->power_mode);
>                /* The ST version does not have this, fall through to POWER_ON */
>                if (host->hw_designer != AMBA_VENDOR_ST) {
>                        pwr |= MCI_PWR_UP;
> diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h
> index f9d1bb5..61b5810 100644
> --- a/include/linux/amba/mmci.h
> +++ b/include/linux/amba/mmci.h
> @@ -17,7 +17,8 @@
>  * mmc/host.h
>  * @translate_vdd: a callback function to translate a MMC_VDD_*
>  * mask into a value to be binary or:ed and written into the
> - * MMCIPWR register of the block
> + * MMCIPWR register of the block.  May also control external power
> + * based on the power_mode.

Actually this callback is named like that for a reason: it is to be used
to translate the MMC_VDD_* into a u8:4 bitmask for the MMCIPWR
register, 4 bits possibly routed out of the PL180 block on some
designs (never seen in practice, but could be used in theory).

So it translates a voltage into a 4-bit bitmask, hence the name.

Now the semantics are altered to have other side-effects in
the platform, so the function should be renamed, something like
platform_vdd_handler() would be more appropriate.

Yours,
Linus Walleij

  reply	other threads:[~2010-06-22 22:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-22  9:17 [PATCH 01/12] mmci: use sg_miter API to fix multi-page sg handling Rabin Vincent
2010-06-22  9:17 ` [PATCH 02/12] mmci: fix multi block transfers Rabin Vincent
2010-07-29 13:18   ` Russell King - ARM Linux
2010-06-22  9:17 ` [PATCH 03/12] mmci: let core poll for card detection Rabin Vincent
2010-06-22  9:17 ` [PATCH 04/12] mmci: allow the card detect status not to be inverted Rabin Vincent
2010-07-29 12:34   ` Russell King - ARM Linux
2010-07-29 13:53     ` Linus Walleij
2010-07-29 14:20       ` Russell King - ARM Linux
2010-08-05  6:14         ` Rabin VINCENT
2010-08-05  9:25           ` Russell King - ARM Linux
2010-08-09 10:37             ` Rabin VINCENT
2010-08-09 11:25               ` Russell King - ARM Linux
2010-06-22  9:17 ` [PATCH 05/12] mmci: support card detection interrupts Rabin Vincent
2010-06-22  9:17 ` [PATCH 06/12] mmci: allow neither ->status nor gpio_cd to be specified Rabin Vincent
2010-06-22  9:17 ` [PATCH 07/12] mmci: pass power_mode to the translate_vdd callback Rabin Vincent
2010-06-22 22:03   ` Linus Walleij [this message]
2010-06-24  8:27     ` Rabin VINCENT
2010-06-24  8:56       ` Linus WALLEIJ
2010-07-19 12:57   ` [PATCHv2 " Rabin Vincent
2010-06-22  9:17 ` [PATCH 08/12] mmci: add variant data and default MCICLOCK support Rabin Vincent
2010-06-22  9:17 ` [PATCH 09/12] mmci: enable hardware flow control on Ux500 variants Rabin Vincent
2010-06-22  9:17 ` [PATCH 10/12] mmci: support larger MMCIDATALENGTH register Rabin Vincent
2010-06-22  9:17 ` [PATCH 11/12] mmci: support different FIFO sizes Rabin Vincent
2010-06-22  9:17 ` [PATCH 12/12] mmci: support variants with only one irq Rabin Vincent
2010-09-23 20:04   ` Linus Walleij
2010-07-07 20:34 ` [PATCH 01/12] mmci: use sg_miter API to fix multi-page sg handling Linus Walleij
2010-07-19 13:23 ` [PATCHv2 " Rabin Vincent

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=AANLkTil2Cb4alVFkfEjXApMgIdkmNvEEarWkT9AhXIdU@mail.gmail.com \
    --to=linus.ml.walleij@gmail.com \
    --cc=STEricsson_nomadik_linux@list.st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=rabin.vincent@stericsson.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;
as well as URLs for NNTP newsgroup(s).