From: Rajendra Nayak <rnayak@ti.com>
To: robherring2@gmail.com, grant.likely@secretlab.ca, cjb@laptop.org
Cc: linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
balajitk@ti.com, svenkatr@ti.com, linaro-dev@lists.linaro.org,
Rajendra Nayak <rnayak@ti.com>
Subject: [PATCH v2 2/4] mmc: omap_hsmmc: Avoid a regulator voltage change with dt
Date: Mon, 12 Mar 2012 20:32:38 +0530 [thread overview]
Message-ID: <1331564560-23276-3-git-send-email-rnayak@ti.com> (raw)
In-Reply-To: <1331564560-23276-1-git-send-email-rnayak@ti.com>
When booting with Device tree, the omap_hsmmc driver does not
program the pbias cell (inside OMAP control module) during
a regulator voltage change.
In case of non-dt boot, this is handled using callbacks
from within platform_data and implemented in machine code.
To be able to do this with device tree, without invoking
any machine code, a OMAP control module driver is needed
which is yet missing.
The pbias cell is used to provide a 1.8v or 3.0v reference
to the mmc/sd/sdio1 interface supporting both 1.8v and 3.0v
voltages.
Until a OMAP control module driver is available to handle this,
when booting with a device tree blob, never change the regulator
voltage which might then require a pbias cell re-program.
There are 2 instances where in the mmc regulator voltage can be
changed.
-1- when the regulator is turned OFF.
-2- when attempting a switch to 1.8v from 3.0v for dual volt cards
This patch avoids a voltage change in both cases when booting from
device tree, and hence compromises on power savings.
Once the OMAP control module driver is available and hsmmc driver
is modified to then do pbias programming even when booting
with device tree, these limitaions can be removed to achieve better
power savings.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
drivers/mmc/host/omap_hsmmc.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 38ae8c0..f29e1a2 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -244,6 +244,13 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on,
*/
if (!host->vcc)
return 0;
+ /*
+ * With DT, never turn OFF the regulator. This is because
+ * the pbias cell programming support is still missing when
+ * booting with Device tree
+ */
+ if (of_have_populated_dt() && !vdd)
+ return 0;
if (mmc_slot(host).before_set_reg)
mmc_slot(host).before_set_reg(dev, slot, power_on, vdd);
@@ -1516,7 +1523,13 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
* of external transceiver; but they all handle 1.8V.
*/
if ((OMAP_HSMMC_READ(host->base, HCTL) & SDVSDET) &&
- (ios->vdd == DUAL_VOLT_OCR_BIT)) {
+ (ios->vdd == DUAL_VOLT_OCR_BIT) &&
+ /*
+ * With pbias cell programming missing, this
+ * can't be allowed when booting with device
+ * tree.
+ */
+ (!of_have_populated_dt())) {
/*
* The mmc_select_voltage fn of the core does
* not seem to set the power_mode to
--
1.7.1
next prev parent reply other threads:[~2012-03-12 15:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-12 15:02 [PATCH v2 0/4] omap hsmmc device tree support Rajendra Nayak
2012-03-12 15:02 ` [PATCH v2 1/4] mmc: omap_hsmmc: Convert hsmmc driver to use device tree Rajendra Nayak
2012-03-12 15:02 ` Rajendra Nayak [this message]
2012-03-12 15:02 ` [PATCH v2 3/4] arm/dts: OMAP4: Add mmc controller nodes and board data Rajendra Nayak
2012-03-12 15:02 ` [PATCH v2 4/4] arm/dts: OMAP3: " Rajendra Nayak
[not found] ` <1331564560-23276-1-git-send-email-rnayak-l0cyMroinI0@public.gmane.org>
2012-03-13 15:43 ` [PATCH v2 0/4] omap hsmmc device tree support T Krishnamoorthy, Balaji
2012-03-14 15:37 ` Chris Ball
-- strict thread matches above, loose matches on Subject: below --
2012-02-23 12:01 Rajendra Nayak
[not found] ` <1329998490-27555-1-git-send-email-rnayak-l0cyMroinI0@public.gmane.org>
2012-02-23 12:01 ` [PATCH v2 2/4] mmc: omap_hsmmc: Avoid a regulator voltage change with dt Rajendra Nayak
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=1331564560-23276-3-git-send-email-rnayak@ti.com \
--to=rnayak@ti.com \
--cc=balajitk@ti.com \
--cc=cjb@laptop.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linaro-dev@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=robherring2@gmail.com \
--cc=svenkatr@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).