public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Ludovic Desroches <ludovic.desroches@atmel.com>,
	Chris Ball <cjb@laptop.org>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv2] mmc: atmel-mci: add vmmc-supply support
Date: Thu, 17 Oct 2013 10:59:20 +0200	[thread overview]
Message-ID: <525FA6E8.5030303@free-electrons.com> (raw)
In-Reply-To: <CAPDyKFpWq+cT5nrqifrt+bNR3acT1rpdyxgfjY-63MCfEC18DA@mail.gmail.com>

On 17/10/2013 10:34, Ulf Hansson wrote:
> On 17 October 2013 00:19, 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>
>> ---
>>
>> Changes in v2:
>>  - use mmc_regulator_get_supply instead of devm_regulator_get
>>
>>  drivers/mmc/host/atmel-mci.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
>> index 69e438e..4ea5333 100644
>> --- a/drivers/mmc/host/atmel-mci.c
>> +++ b/drivers/mmc/host/atmel-mci.c
>> @@ -23,6 +23,7 @@
>>  #include <linux/of_device.h>
>>  #include <linux/of_gpio.h>
>>  #include <linux/platform_device.h>
>> +#include <linux/regulator/consumer.h>
>>  #include <linux/scatterlist.h>
>>  #include <linux/seq_file.h>
>>  #include <linux/slab.h>
>> @@ -2198,6 +2199,14 @@ static int __init atmci_init_slot(struct atmel_mci *host,
>>         host->slot[id] = slot;
>>         mmc_add_host(mmc);
>>
>> +       mmc_regulator_get_supply(mmc);
>> +       if (!IS_ERR(mmc->supply.vmmc)) {
>> +               int ret = regulator_enable(mmc->supply.vmmc);
> You should not enable the regulator here, instead handle that from the
> .set_ios function. This complete code chunk must also be moved prior
> to mmc_add_host above.

Right, I was wondering about that. I actually had a version where it was
before mmc_add_host
>
> When enabling/disabling the regulator from the .set_ios, I suppose you
> want to use mmc_regulator_set_ocr API instead.

Oh right, I pretty new to the mmc subsystem and I was probably to tired
to find that one yesterday. I actually looked for regulator_enable in
mmc/core/core.c and didn't see it ...

Thank you for your prompt reviews.


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


      reply	other threads:[~2013-10-17  8:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16 22:19 [PATCHv2] mmc: atmel-mci: add vmmc-supply support Alexandre Belloni
2013-10-17  8:34 ` Ulf Hansson
2013-10-17  8:59   ` Alexandre Belloni [this message]

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=525FA6E8.5030303@free-electrons.com \
    --to=alexandre.belloni@free-electrons.com \
    --cc=cjb@laptop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ludovic.desroches@atmel.com \
    --cc=ulf.hansson@linaro.org \
    /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