linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: "Chaotian Jing" <chaotian.jing@mediatek.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"James Liao" <jamesjj.liao@mediatek.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	srv_heupstream <srv_heupstream@mediatek.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Hongzhou Yang" <hongzhou.yang@mediatek.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Bin Zhang (章斌)" <bin.zhang@mediatek.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	"Chris Ball" <chris@printf.net>,
	"Will Deacon" <will.deacon@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	linux-mediatek@lists.infradead.org,
	"Sascha Hauer" <kernel@pengutronix.de>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Joe.C" <yingjoe.chen@mediatek.com>,
	"Eddie Huang" <eddie.huang@mediatek.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 2/5] mmc: mediatek: Add Mediatek MMC driver
Date: Fri, 17 Apr 2015 11:37:44 +0200	[thread overview]
Message-ID: <CAPDyKFr5NDTnx_3brksimhqGj+0Rk=tH5fLfWyRddRdPf7i6Lg@mail.gmail.com> (raw)
In-Reply-To: <20150417091213.GM4946@pengutronix.de>

On 17 April 2015 at 11:12, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> Ulf,
>
> On Tue, Mar 31, 2015 at 02:23:06PM +0200, Ulf Hansson wrote:
>> On 17 March 2015 at 04:13, Chaotian Jing <chaotian.jing@mediatek.com> wrote:
>> > +
>> > +       msdc_set_buswidth(host, ios->bus_width);
>> > +
>> > +       /* Suspend/Resume will do power off/on */
>> > +       switch (ios->power_mode) {
>> > +       case MMC_POWER_UP:
>> > +               msdc_init_hw(host);
>> > +               if (!IS_ERR(mmc->supply.vmmc)) {
>> > +                       ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc,
>> > +                                       ios->vdd);
>> > +                       if (ret) {
>> > +                               dev_err(host->dev, "Failed to set vmmc power!\n");
>> > +                               return;
>> > +                       }
>> > +               }
>> > +               break;
>> > +       case MMC_POWER_ON:
>> > +               if (!IS_ERR(mmc->supply.vqmmc)) {
>> > +                       ret = regulator_enable(mmc->supply.vqmmc);
>>
>> The calls to regulator_enable|disable() for the vqmmc will not be
>> balanced properly here. You need a local cache variable like
>> "is_enabled" to keep track of this.
>
> Shouldn't the MMC core provide balanced hooks for this? What about
> MMC_POWER_UP, can this be used for enabling regulators?

Currently host drivers deals with vqmmc enabling/disabling, setting
voltage, etc - entirely by them selves.

Dough Anderson is working on fixing that:
http://lkml.iu.edu/hypermail/linux/kernel/1503.1/03108.html

MMC_POWER_UP is when vmmc shall be enabled.

MMC_POWER_ON is when vqmmc shall be enabled.

Kind regards
Uffe

  reply	other threads:[~2015-04-17  9:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1426562035-16709-1-git-send-email-chaotian.jing@mediatek.com>
     [not found] ` <1426562035-16709-4-git-send-email-chaotian.jing@mediatek.com>
2015-03-31 14:46   ` [PATCH v2 3/5] mmc: mediatek: Add PM support for MMC driver Ulf Hansson
2015-04-03  8:27     ` 答复: " Chaotian Jing (井朝天)
2015-04-20  6:49   ` Sascha Hauer
2015-04-20  6:52   ` Sascha Hauer
     [not found] ` <1426562035-16709-3-git-send-email-chaotian.jing@mediatek.com>
2015-03-31 12:23   ` [PATCH v2 2/5] mmc: mediatek: Add Mediatek " Ulf Hansson
2015-04-03  7:22     ` 答复: " Chaotian Jing (井朝天)
2015-04-08 10:38       ` Ulf Hansson
2015-04-17  9:12     ` Sascha Hauer
2015-04-17  9:37       ` Ulf Hansson [this message]
2015-04-07 14:01   ` Matthias Brugger
2015-04-17 13:45   ` Sascha Hauer
     [not found] ` <1426562035-16709-2-git-send-email-chaotian.jing@mediatek.com>
2015-04-20  8:31   ` [PATCH v2 1/5] mmc: dt-bindings: add Mediatek MMC bindings Sascha Hauer

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='CAPDyKFr5NDTnx_3brksimhqGj+0Rk=tH5fLfWyRddRdPf7i6Lg@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=arnd@arndb.de \
    --cc=bin.zhang@mediatek.com \
    --cc=catalin.marinas@arm.com \
    --cc=chaotian.jing@mediatek.com \
    --cc=chris@printf.net \
    --cc=devicetree@vger.kernel.org \
    --cc=eddie.huang@mediatek.com \
    --cc=hongzhou.yang@mediatek.com \
    --cc=jamesjj.liao@mediatek.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=srv_heupstream@mediatek.com \
    --cc=will.deacon@arm.com \
    --cc=yingjoe.chen@mediatek.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).