summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJassi Brar <jaswinder.singh@linaro.org>2012-07-16 17:45:46 +0800
committerAndy Green <andy.green@linaro.org>2012-07-19 17:04:25 +0800
commit47f1444648a2c09221a5162ffa9702a9fd912ee0 (patch)
tree462cbdac7d9595dc6f57b97d269365cc0b0f254a
parentb199d35e76bb81a491c3ac57cf8d529c953cdd48 (diff)
downloadpanda-47f1444648a2c09221a5162ffa9702a9fd912ee0.tar.gz
OMAP: HSMMC: Track regulator enabled locally
The regulator api doesn't differentiate between a real and a dummy reg. The latter is always reported enabled, the local flag 'regulator_enabled' tracks if the driver explicitly enabled the regulator, otherwise we get imbalance in calls to enable/disable when its a dummy regulator. Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r--drivers/mmc/host/omap_hsmmc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index de6a643b068..cb1901495c2 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -287,12 +287,13 @@ static int omap_hsmmc_1_set_power(struct device *dev, int slot, int power_on,
if (host->vcc_aux && !host->regulator_enabled && !ret) {
ret = regulator_enable(host->vcc_aux);
- if (!ret)
+ if (!ret) {
host->regulator_enabled = 1;
msleep(100);
+ }
}
} else {
- if (host->vcc_aux && regulator_is_enabled(host->vcc_aux) > 0) {
+ if (host->vcc_aux && host->regulator_enabled) {
ret = regulator_disable(host->vcc_aux);
if (!ret)
host->regulator_enabled = 0;