[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFr5NDTnx_3brksimhqGj+0Rk=tH5fLfWyRddRdPf7i6Lg@mail.gmail.com>
Date: Fri, 17 Apr 2015 11:37:44 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Sascha Hauer <s.hauer@...gutronix.de>
Cc: Chaotian Jing <chaotian.jing@...iatek.com>,
Mark Rutland <mark.rutland@....com>,
James Liao <jamesjj.liao@...iatek.com>,
Arnd Bergmann <arnd@...db.de>,
srv_heupstream <srv_heupstream@...iatek.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Hongzhou Yang <hongzhou.yang@...iatek.com>,
Catalin Marinas <catalin.marinas@....com>,
Bin Zhang (章斌) <bin.zhang@...iatek.com>,
linux-mmc <linux-mmc@...r.kernel.org>,
Chris Ball <chris@...ntf.net>,
Will Deacon <will.deacon@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
Rob Herring <robh+dt@...nel.org>,
linux-mediatek@...ts.infradead.org,
Sascha Hauer <kernel@...gutronix.de>,
Matthias Brugger <matthias.bgg@...il.com>,
"Joe.C" <yingjoe.chen@...iatek.com>,
Eddie Huang <eddie.huang@...iatek.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v2 2/5] mmc: mediatek: Add Mediatek MMC driver
On 17 April 2015 at 11:12, Sascha Hauer <s.hauer@...gutronix.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@...iatek.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists