diff options
author | Jassi Brar <jaswinder.singh@linaro.org> | 2012-07-16 17:45:46 +0800 |
---|---|---|
committer | Xavier Boudet <x-boudet@ti.com> | 2012-07-23 18:23:45 +0200 |
commit | a3df42492aa8c216e83ca9dd5f537c24de0089a8 (patch) | |
tree | ec440b3116fbacb5d3670f664c96532416768749 | |
parent | 4cc9ecff8ed1912ea679dc71b03a32045d88946a (diff) |
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.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index de6a643b0689..cb1901495c2d 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; |