[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1289298937.3020.34.camel@realization>
Date: Tue, 09 Nov 2010 11:35:37 +0100
From: Alberto Panizzo <maramaopercheseimorto@...il.com>
To: Chris Ball <cjb@...top.org>
Cc: Daniel Mack <daniel@...aq.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Eric Bénard <eric@...rea.com>,
Fabio Estevam <fabioestevam@...oo.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-mmc <linux-mmc@...r.kernel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Linus Walleij <linus.ml.walleij@...il.com>
Subject: [PATCH v2] mxcmmc: update the regulator support code to the latest
API
This fix also the build problem introduced by my previous patch
due to not handled API changes introduced by commit:
99fc513 (mmc: Move regulator handling closer to core)
Signed-off-by: Alberto Panizzo <maramaopercheseimorto@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists