From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org,
Kyungmin Park <kyungmin.park@samsung.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@ti.com>, Chris Ball <cjb@laptop.org>,
Kevin Liu <keyuan.liu@gmail.com>
Subject: Re: [PATCH 3/3 RESEND] mmc: sdhci: check voltage range only on regulators aware of voltage value
Date: Wed, 13 Feb 2013 08:33:12 +0100 [thread overview]
Message-ID: <511B41B8.3060506@samsung.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1302122309470.14434@axis700.grange>
Hello,
On 2/12/2013 11:10 PM, Guennadi Liakhovetski wrote:
> Hi Marek
>
> On Tue, 12 Feb 2013, Marek Szyprowski wrote:
>
> > Some regulators don't report any voltage values, so checking supported
> > voltage range results in disabling all SDHCI_CAN_VDD_* flags and
> > registration failure. This patch finally provides a correct fix for the
> > registration of SDHCI driver with all possible voltage regulators:
> > dummy, fixed and regulated without using regulator_count_voltages()
> > hacks.
> >
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > ---
> > drivers/mmc/host/sdhci.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> > index ba586ae..735526b 100644
> > --- a/drivers/mmc/host/sdhci.c
> > +++ b/drivers/mmc/host/sdhci.c
> > @@ -2976,7 +2976,11 @@ int sdhci_add_host(struct sdhci_host *host)
> > }
> >
> > #ifdef CONFIG_REGULATOR
> > - if (host->vmmc) {
> > + /*
> > + * Voltage range check makes sense only if regulator reports
> > + * any voltage value.
> > + */
> > + if (host->vmmc && regulator_get_voltage(host->vmmc) > 0) {
> > ret = regulator_is_supported_voltage(host->vmmc, 2700000,
> > 3600000);
>
> Wouldn't using mmc_regulator_get_ocrmask() be a better option?
The idea behind this patch it to avoid messing ocr mask and voltage
regulators when voltage regulator is a simple on/off switch, which doesn't
report any value. This solves the serious problems with sdhci driver when
dummy regulator is enabled in kconfig, otherwise the sdhci driver
concludes that no supported voltage is available and fails to initialize.
Using mmc_regulator_get_ocrmask() won't solve this problem.
BTW, mmc_regulator_get_ocrmask() won't work with continuous range
regulators.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
next prev parent reply other threads:[~2013-02-13 7:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-04 14:01 [PATCH v2 0/3] Fix fixed regulators support Marek Szyprowski
2012-12-04 14:01 ` [PATCH 1/3] regulators: add regulator_can_change_voltage() function Marek Szyprowski
2012-12-06 6:18 ` Mark Brown
2012-12-04 14:01 ` [PATCH 2/3] mmc: use regulator_can_change_voltage() instead of regulator_count_voltages() hacks Marek Szyprowski
2013-02-01 14:39 ` Marek Szyprowski
2013-02-11 17:26 ` Chris Ball
2012-12-04 14:01 ` [PATCH 3/3] mmc: sdhci: check voltage range only on regulators aware of voltage value Marek Szyprowski
2012-12-04 14:50 ` Kevin Liu
2012-12-05 1:48 ` Mark Brown
2012-12-05 2:12 ` Kevin Liu
2013-02-01 14:40 ` Marek Szyprowski
2013-02-11 17:27 ` Chris Ball
2013-02-12 8:01 ` [PATCH 3/3 RESEND] " Marek Szyprowski
2013-02-12 22:10 ` Guennadi Liakhovetski
2013-02-13 7:33 ` Marek Szyprowski [this message]
2013-02-13 7:45 ` Guennadi Liakhovetski
2013-02-13 11:35 ` Mark Brown
2013-02-14 8:05 ` Marek Szyprowski
2013-02-14 11:03 ` Mark Brown
2013-02-14 11:08 ` Ulf Hansson
2013-02-20 9:34 ` Kevin Liu
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=511B41B8.3060506@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=cjb@laptop.org \
--cc=g.liakhovetski@gmx.de \
--cc=keyuan.liu@gmail.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=lrg@ti.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).