lkml.org 
[lkml]   [2013]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCHv3] mmc: atmel-mci: add vmmc-supply support
From
On 17 October 2013 12:46, Alexandre Belloni
<alexandre.belloni@free-electrons.com> wrote:
> Other MMC hosts handle a regulator named vmmc-supply that allows to power the
> MMC card or SDIO device before communicating on the bus.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

> ---
>
> Changes in v2:
> - use mmc_regulator_get_supply instead of devm_regulator_get
>
> Changes in v3:
> - en/disable the regulator in .set_ios using mmc_regulator_set_ocr
>
> drivers/mmc/host/atmel-mci.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index 69e438e..a9e1ba6 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -1385,8 +1385,14 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> clk_unprepare(host->mck);
>
> switch (ios->power_mode) {
> + case MMC_POWER_OFF:
> + if (!IS_ERR(mmc->supply.vmmc))
> + mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
> + break;
> case MMC_POWER_UP:
> set_bit(ATMCI_CARD_NEED_INIT, &slot->flags);
> + if (!IS_ERR(mmc->supply.vmmc))
> + mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
> break;
> default:
> /*
> @@ -2196,6 +2202,7 @@ static int __init atmci_init_slot(struct atmel_mci *host,
> }
>
> host->slot[id] = slot;
> + mmc_regulator_get_supply(mmc);
> mmc_add_host(mmc);
>
> if (gpio_is_valid(slot->detect_pin)) {
> --
> 1.8.1.2
>


\
 
 \ /
  Last update: 2013-10-17 16:21    [W:0.082 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site