[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1246057668.10360.316.camel@brutus>
Date: Fri, 26 Jun 2009 20:07:48 -0300
From: Daniel Ribeiro <drwyrm@...il.com>
To: Pierre Ossman <pierre@...man.eu>,
linux-kernel <linux-kernel@...r.kernel.org>
Cc: Eric Miao <eric.y.miao@...il.com>,
Mark Brown <broonie@...ena.org.uk>,
openezx-devel <openezx-devel@...ts.openezx.org>,
David Brownell <dbrownell@...rs.sourceforge.net>,
Liam Girdwood <lrg@...mlogic.co.uk>,
linux-arm-kernel <linux-arm-kernel@...ts.arm.linux.org.uk>
Subject: [PATCH 1/2] MMC/pxamci: workaround regulator framework bugs
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@...il.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
Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)
Powered by blists - more mailing lists