diff options
author | Alberto Panizzo <maramaopercheseimorto@gmail.com> | 2010-11-09 05:35:37 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-01-08 21:49:11 -0500 |
commit | d078d24242ff6c36338991627f9c63b2d48a6eee (patch) | |
tree | b90c964aa6bb3b999abbe4b2d4895246103bc90e /drivers/mmc/host/mxcmmc.c | |
parent | 74b66954ebfcef9bc26d9c377d32fbd46b4ddc32 (diff) |
mmc: mxcmmc: update the regulator support code to the latest API
This also fixes the build problem introduced by my previous patch
due to unhandled API changes introduced by commit:
99fc513101 (mmc: Move regulator handling closer to core)
Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/mxcmmc.c')
-rw-r--r-- | 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 1a7f48c3c554..2b9f7c856700 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); | |||
150 | 150 | ||
151 | static inline void mxcmci_init_ocr(struct mxcmci_host *host) | 151 | static inline void mxcmci_init_ocr(struct mxcmci_host *host) |
152 | { | 152 | { |
153 | #ifdef CONFIG_REGULATOR | ||
154 | host->vcc = regulator_get(mmc_dev(host->mmc), "vmmc"); | 153 | host->vcc = regulator_get(mmc_dev(host->mmc), "vmmc"); |
155 | 154 | ||
156 | if (IS_ERR(host->vcc)) { | 155 | if (IS_ERR(host->vcc)) { |
@@ -161,7 +160,7 @@ static inline void mxcmci_init_ocr(struct mxcmci_host *host) | |||
161 | dev_warn(mmc_dev(host->mmc), | 160 | dev_warn(mmc_dev(host->mmc), |
162 | "pdata->ocr_avail will not be used\n"); | 161 | "pdata->ocr_avail will not be used\n"); |
163 | } | 162 | } |
164 | #endif | 163 | |
165 | if (host->vcc == NULL) { | 164 | if (host->vcc == NULL) { |
166 | /* fall-back to platform data */ | 165 | /* fall-back to platform data */ |
167 | if (host->pdata && host->pdata->ocr_avail) | 166 | if (host->pdata && host->pdata->ocr_avail) |
@@ -171,12 +170,17 @@ static inline void mxcmci_init_ocr(struct mxcmci_host *host) | |||
171 | } | 170 | } |
172 | } | 171 | } |
173 | 172 | ||
174 | static inline void mxcmci_set_power(struct mxcmci_host *host, unsigned int vdd) | 173 | static inline void mxcmci_set_power(struct mxcmci_host *host, |
174 | unsigned char power_mode, | ||
175 | unsigned int vdd) | ||
175 | { | 176 | { |
176 | #ifdef CONFIG_REGULATOR | 177 | if (host->vcc) { |
177 | if (host->vcc) | 178 | if (power_mode == MMC_POWER_UP) |
178 | mmc_regulator_set_ocr(host->vcc, vdd); | 179 | mmc_regulator_set_ocr(host->mmc, host->vcc, vdd); |
179 | #endif | 180 | else if (power_mode == MMC_POWER_OFF) |
181 | mmc_regulator_set_ocr(host->mmc, host->vcc, 0); | ||
182 | } | ||
183 | |||
180 | if (host->pdata && host->pdata->setpower) | 184 | if (host->pdata && host->pdata->setpower) |
181 | host->pdata->setpower(mmc_dev(host->mmc), vdd); | 185 | host->pdata->setpower(mmc_dev(host->mmc), vdd); |
182 | } | 186 | } |
@@ -716,7 +720,7 @@ static void mxcmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
716 | host->cmdat &= ~CMD_DAT_CONT_BUS_WIDTH_4; | 720 | host->cmdat &= ~CMD_DAT_CONT_BUS_WIDTH_4; |
717 | 721 | ||
718 | if (host->power_mode != ios->power_mode) { | 722 | if (host->power_mode != ios->power_mode) { |
719 | mxcmci_set_power(host, ios->vdd); | 723 | mxcmci_set_power(host, ios->power_mode, ios->vdd); |
720 | host->power_mode = ios->power_mode; | 724 | host->power_mode = ios->power_mode; |
721 | 725 | ||
722 | if (ios->power_mode == MMC_POWER_ON) | 726 | if (ios->power_mode == MMC_POWER_ON) |