diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2010-09-29 01:08:27 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2010-10-23 09:11:16 -0400 |
commit | 99fc5131018cbdc3cf42ce09fb394a4e8b053c74 (patch) | |
tree | 68638188b665af5add8d885b3e22a6edd537de7e /include/linux/mmc | |
parent | 4d0b8611cd4da64f075b8e07a126f0eb498fb153 (diff) |
mmc: Move regulator handling closer to core
After discovering a problem in regulator reference counting I took Mark
Brown's advice to move the reference count into the MMC core by making the
regulator status a member of struct mmc_host.
I took this opportunity to also implement NULL versions of
the regulator functions so as to rid the driver code from
some ugly #ifdef CONFIG_REGULATOR clauses.
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Adrian Hunter <adrian.hunter@nokia.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Sundar Iyer <sundar.iyer@stericsson.com>
Cc: Daniel Mack <daniel@caiaq.de>
Cc: Pierre Ossman <pierre@ossman.eu>
Cc: Matt Fleming <matt@console-pimps.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Cliff Brake <cbrake@bec-systems.com>
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'include/linux/mmc')
-rw-r--r-- | include/linux/mmc/host.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 20be040649a9..ccac56ae1286 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -212,6 +212,10 @@ struct mmc_host { | |||
212 | struct led_trigger *led; /* activity led */ | 212 | struct led_trigger *led; /* activity led */ |
213 | #endif | 213 | #endif |
214 | 214 | ||
215 | #ifdef CONFIG_REGULATOR | ||
216 | bool regulator_enabled; /* regulator state */ | ||
217 | #endif | ||
218 | |||
215 | struct dentry *debugfs_root; | 219 | struct dentry *debugfs_root; |
216 | 220 | ||
217 | unsigned long private[0] ____cacheline_aligned; | 221 | unsigned long private[0] ____cacheline_aligned; |
@@ -250,8 +254,24 @@ static inline void mmc_signal_sdio_irq(struct mmc_host *host) | |||
250 | 254 | ||
251 | struct regulator; | 255 | struct regulator; |
252 | 256 | ||
257 | #ifdef CONFIG_REGULATOR | ||
253 | int mmc_regulator_get_ocrmask(struct regulator *supply); | 258 | int mmc_regulator_get_ocrmask(struct regulator *supply); |
254 | int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit); | 259 | int mmc_regulator_set_ocr(struct mmc_host *mmc, |
260 | struct regulator *supply, | ||
261 | unsigned short vdd_bit); | ||
262 | #else | ||
263 | static inline int mmc_regulator_get_ocrmask(struct regulator *supply) | ||
264 | { | ||
265 | return 0; | ||
266 | } | ||
267 | |||
268 | static inline int mmc_regulator_set_ocr(struct mmc_host *mmc, | ||
269 | struct regulator *supply, | ||
270 | unsigned short vdd_bit) | ||
271 | { | ||
272 | return 0; | ||
273 | } | ||
274 | #endif | ||
255 | 275 | ||
256 | int mmc_card_awake(struct mmc_host *host); | 276 | int mmc_card_awake(struct mmc_host *host); |
257 | int mmc_card_sleep(struct mmc_host *host); | 277 | int mmc_card_sleep(struct mmc_host *host); |