All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alberto Panizzo <maramaopercheseimorto@gmail.com>
To: Chris Ball <cjb@laptop.org>
Cc: "Daniel Mack" <daniel@caiaq.de>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Eric Bénard" <eric@eukrea.com>,
	"Fabio Estevam" <fabioestevam@yahoo.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Linus Walleij" <linus.ml.walleij@gmail.com>
Subject: [PATCH] mxcmmc: update the regulator support code to the latest API
Date: Tue, 09 Nov 2010 11:09:50 +0100	[thread overview]
Message-ID: <1289297390.3020.27.camel@realization> (raw)
In-Reply-To: <20101108143746.GA23201@void.printf.net>


This fix also the build problem introduced by my previous patch
due to unhanded API changes introduced by
commit:99fc5131018cbdc3cf42ce09fb394a4e8b053c74

Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
---

This patch apply to the current mmc-next branch

 drivers/mmc/host/mxcmmc.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index 1a7f48c..2b9f7c8 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -150,7 +150,6 @@ static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios);
 
 static inline void mxcmci_init_ocr(struct mxcmci_host *host)
 {
-#ifdef CONFIG_REGULATOR
 	host->vcc = regulator_get(mmc_dev(host->mmc), "vmmc");
 
 	if (IS_ERR(host->vcc)) {
@@ -161,7 +160,7 @@ static inline void mxcmci_init_ocr(struct mxcmci_host *host)
 			dev_warn(mmc_dev(host->mmc),
 				"pdata->ocr_avail will not be used\n");
 	}
-#endif
+
 	if (host->vcc == NULL) {
 		/* fall-back to platform data */
 		if (host->pdata && host->pdata->ocr_avail)
@@ -171,12 +170,17 @@ static inline void mxcmci_init_ocr(struct mxcmci_host *host)
 	}
 }
 
-static inline void mxcmci_set_power(struct mxcmci_host *host, unsigned int vdd)
+static inline void mxcmci_set_power(struct mxcmci_host *host,
+				    unsigned char power_mode,
+				    unsigned int vdd)
 {
-#ifdef CONFIG_REGULATOR
-	if (host->vcc)
-		mmc_regulator_set_ocr(host->vcc, vdd);
-#endif
+	if (host->vcc) {
+		if (power_mode == MMC_POWER_UP)
+			mmc_regulator_set_ocr(host->mmc, host->vcc, vdd);
+		else if (power_mode == MMC_POWER_OFF)
+			mmc_regulator_set_ocr(host->mmc, host->vcc, 0);
+	}
+
 	if (host->pdata && host->pdata->setpower)
 		host->pdata->setpower(mmc_dev(host->mmc), vdd);
 }
@@ -716,7 +720,7 @@ static void mxcmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		host->cmdat &= ~CMD_DAT_CONT_BUS_WIDTH_4;
 
 	if (host->power_mode != ios->power_mode) {
-		mxcmci_set_power(host, ios->vdd);
+		mxcmci_set_power(host, ios->power_mode, ios->vdd);
 		host->power_mode = ios->power_mode;
 
 		if (ios->power_mode == MMC_POWER_ON)
-- 
1.6.3.3




  parent reply	other threads:[~2010-11-09 10:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-02  0:05 [PATCH] mxcmmc: Add the ability to bind a regulator to manage the MMC card voltage Alberto Panizzo
2010-11-02  7:39 ` Sascha Hauer
2010-11-02 10:33   ` Alberto Panizzo
2010-11-05  9:27   ` Alberto Panizzo
2010-11-05 13:12     ` Sascha Hauer
2010-11-08 10:53     ` Alberto Panizzo
2010-11-08 14:37       ` Chris Ball
2010-11-08 15:25         ` Alberto Panizzo
2010-11-09 10:09         ` Alberto Panizzo [this message]
2010-11-09 10:14           ` [PATCH] mxcmmc: update the regulator support code to the latest API Uwe Kleine-König
2010-11-09 10:30             ` Alberto Panizzo
2010-11-09 10:35         ` [PATCH v2] " Alberto Panizzo
2010-11-08 22:12 ` [PATCH] mxcmmc: Add the ability to bind a regulator to manage the MMC card voltage Linus Walleij
2010-11-09 10:03   ` Alberto Panizzo

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=1289297390.3020.27.camel@realization \
    --to=maramaopercheseimorto@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cjb@laptop.org \
    --cc=daniel@caiaq.de \
    --cc=eric@eukrea.com \
    --cc=fabioestevam@yahoo.com \
    --cc=linus.ml.walleij@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.