From: Daniel Ribeiro <drwyrm@gmail.com>
To: Pierre Ossman <pierre@ossman.eu>,
linux-kernel <linux-kernel@vger.kernel.org>
Cc: Eric Miao <eric.y.miao@gmail.com>,
Mark Brown <broonie@sirena.org.uk>,
openezx-devel <openezx-devel@lists.openezx.org>,
David Brownell <dbrownell@users.sourceforge.net>,
Liam Girdwood <lrg@slimlogic.co.uk>,
linux-arm-kernel <linux-arm-kernel@lists.arm.linux.org.uk>
Subject: [PATCH 1/2] MMC/pxamci: workaround regulator framework bugs
Date: Fri, 26 Jun 2009 20:07:48 -0300 [thread overview]
Message-ID: <1246057668.10360.316.camel@brutus> (raw)
[-- Attachment #1: Type: text/plain, Size: 1349 bytes --]
The voltage regulator framework can't sanely deal with voltage
regulators which are left enabled by the bootloader. We workaround this
by forcing an enable()/disable() pair so it has a sane use_count.
Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
---
drivers/mmc/host/pxamci.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index d7d7109..20fb3da 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -80,6 +80,18 @@ static inline void pxamci_init_ocr(struct pxamci_host *host)
if (IS_ERR(host->vcc))
host->vcc = NULL;
else {
+ /*
+ * When the bootloader leaves a supply active, it's
+ * initialized with zero usecount ... and we can't
+ * disable it without first enabling it. Until the
+ * framework is fixed, we need a workaround like this
+ * (which is safe for MMC, but not in general).
+ */
+ if (regulator_is_enabled(host->vcc) > 0) {
+ regulator_enable(host->vcc);
+ regulator_disable(host->vcc);
+ }
+
host->mmc->ocr_avail = mmc_regulator_get_ocrmask(host->vcc);
if (host->pdata && host->pdata->ocr_mask)
dev_warn(mmc_dev(host->mmc),
--
tg: (87da0bf..) mmc/workaround-regulator-bugs (depends on: mmc/pxamci-regulator-support)
--
Daniel Ribeiro
[-- Attachment #2: Esta é uma parte de mensagem assinada digitalmente --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next reply other threads:[~2009-06-26 23:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-26 23:07 Daniel Ribeiro [this message]
2009-06-27 0:48 ` [PATCH 1/2] MMC/pxamci: workaround regulator framework bugs Mark Brown
2009-06-27 2:55 ` Daniel Ribeiro
2009-06-29 3:00 ` Eric Miao
2009-06-29 9:43 ` Mark Brown
2009-07-01 2:36 ` David Brownell
2009-07-01 11:46 ` Mark Brown
2009-07-22 21:03 ` David Brownell
2009-07-24 14:35 ` Mark Brown
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=1246057668.10360.316.camel@brutus \
--to=drwyrm@gmail.com \
--cc=broonie@sirena.org.uk \
--cc=dbrownell@users.sourceforge.net \
--cc=eric.y.miao@gmail.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
--cc=openezx-devel@lists.openezx.org \
--cc=pierre@ossman.eu \
/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