devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rajendra Nayak <rnayak-l0cyMroinI0@public.gmane.org>
To: linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
	balajitk-l0cyMroinI0@public.gmane.org,
	Rajendra Nayak <rnayak-l0cyMroinI0@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: [PATCH v2 2/4] mmc: omap_hsmmc: Avoid a regulator voltage change with dt
Date: Thu, 23 Feb 2012 17:31:28 +0530	[thread overview]
Message-ID: <1329998490-27555-3-git-send-email-rnayak@ti.com> (raw)
In-Reply-To: <1329998490-27555-1-git-send-email-rnayak-l0cyMroinI0@public.gmane.org>

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-l0cyMroinI0@public.gmane.org>
---
 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 0c93d58..dffde8d 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -245,6 +245,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);
@@ -1537,7 +1544,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

  parent reply	other threads:[~2012-02-23 12:01 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 12:01 [PATCH v2 0/4] omap hsmmc device tree support Rajendra Nayak
     [not found] ` <1329998490-27555-1-git-send-email-rnayak-l0cyMroinI0@public.gmane.org>
2012-02-23 12:01   ` [PATCH v2 1/4] mmc: omap_hsmmc: Convert hsmmc driver to use device tree Rajendra Nayak
     [not found]     ` <1329998490-27555-2-git-send-email-rnayak-l0cyMroinI0@public.gmane.org>
2012-02-24 11:32       ` T Krishnamoorthy, Balaji
2012-02-24 11:35         ` Rajendra Nayak
     [not found]           ` <4F4775FF.2090500-l0cyMroinI0@public.gmane.org>
2012-02-24 12:51             ` Cousson, Benoit
2012-02-24 12:58               ` Rajendra Nayak
     [not found]                 ` <4F478963.20009-l0cyMroinI0@public.gmane.org>
2012-02-24 13:02                   ` Cousson, Benoit
2012-02-24 13:04                     ` Rajendra Nayak
2012-03-08  3:46     ` Rajendra Nayak
2012-03-08 15:58       ` Rob Herring
2012-03-09  5:42     ` Grant Likely
2012-03-09  9:21       ` Rajendra Nayak
2012-02-23 12:01   ` Rajendra Nayak [this message]
2012-02-23 12:01   ` [PATCH v2 3/4] arm/dts: OMAP4: Add mmc controller nodes and board data Rajendra Nayak
2012-02-24 10:16     ` T Krishnamoorthy, Balaji
2012-02-24 10:26       ` Rajendra Nayak
     [not found]         ` <4F4765EC.1000102-l0cyMroinI0@public.gmane.org>
2012-02-24 10:37           ` Russell King - ARM Linux
2012-02-24 10:59         ` T Krishnamoorthy, Balaji
2012-03-09 15:49         ` Grant Likely
2012-02-23 12:01   ` [PATCH v2 4/4] arm/dts: OMAP3: " Rajendra Nayak
2012-02-23 18:57     ` Tony Lindgren
2012-02-24  4:00       ` Rajendra Nayak
     [not found]         ` <4F470B71.1020308-l0cyMroinI0@public.gmane.org>
2012-02-24 11:23           ` Cousson, Benoit
2012-02-24 18:49         ` Tony Lindgren
2012-03-09  5:46           ` Grant Likely
2012-03-09  6:51             ` Paul Walmsley
2012-03-09  9:36               ` Rajendra Nayak
2012-03-09  9:26             ` Rajendra Nayak
2012-02-23 12:13 ` [PATCH v2 0/4] omap hsmmc device tree support Rajendra Nayak
  -- strict thread matches above, loose matches on Subject: below --
2012-03-12 15:02 Rajendra Nayak
2012-03-12 15:02 ` [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=1329998490-27555-3-git-send-email-rnayak@ti.com \
    --to=rnayak-l0cymroini0@public.gmane.org \
    --cc=balajitk-l0cyMroinI0@public.gmane.org \
    --cc=cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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).