summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2013-08-29 10:35:30 +0800
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 13:44:26 -0700
commit018b0aec4501f8ba4683529e09645d130e023fdc (patch)
treec16a7a411a009e1a76390245296cd84ffe33421d /drivers/regulator
parent1316c0c9a10b366dbbcd0a473db4a71760ad41d2 (diff)
regulator: palmas: make sure disable boost during suspend for SMPS10
If flag for SMPS10 has the disable_boost_on_suspend is true then make sure that boost of SMPS10 is disabled. If any regulator is using this then defer the boost disable and disable when client actually disable the smps10. bug 1291841 Change-Id: Ia03d29f68132f87b970d4df8402b3cdd4dba95df Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Hunk Lin <hulin@nvidia.com> Reviewed-on: http://git-master/r/239722 (cherry picked from commit 368abfad3a0b27fa893df2d1b201339701df367d) Reviewed-on: http://git-master/r/267662 GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/palmas-regulator.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 9adb617df977..a425c65a899a 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -305,6 +305,9 @@ static unsigned int palmas_smps_ramp_delay[4] = {0, 10000, 5000, 2500};
#define REGULATOR_SLAVE 0
+static void palmas_disable_smps10_boost(struct palmas *palmas);
+static void palmas_enable_smps10_boost(struct palmas *palmas);
+
static int palmas_smps_read(struct palmas *palmas, unsigned int reg,
unsigned int *dest)
{
@@ -635,6 +638,7 @@ static int palmas_enable_smps10(struct regulator_dev *dev)
if (!(EXT_PWR_REQ & pmic->roof_floor[id]))
ret = regulator_enable_regmap(dev);
+ palmas_enable_smps10_boost(pmic->palmas);
pmic->smps10_regulator_enabled = true;
return ret;
}
@@ -649,6 +653,12 @@ static int palmas_disable_smps10(struct regulator_dev *dev)
ret = regulator_disable_regmap(dev);
pmic->smps10_regulator_enabled = false;
+
+ if (pmic->smps10_boost_disable_deferred) {
+ palmas_disable_smps10_boost(pmic->palmas);
+ pmic->smps10_boost_disable_deferred = false;
+ }
+
return ret;
}
@@ -1797,9 +1807,12 @@ static int palmas_suspend(struct device *dev)
struct palmas_pmic_platform_data *pdata = dev_get_platdata(dev);
int id;
- if (pdata->disable_smps10_boost_suspend &&
- !pmic->smps10_regulator_enabled)
- palmas_disable_smps10_boost(palmas);
+ if (pdata->disable_smps10_boost_suspend) {
+ if (!pmic->smps10_regulator_enabled)
+ palmas_disable_smps10_boost(palmas);
+ else
+ pmic->smps10_boost_disable_deferred = true;
+ }
for (id = 0; id < PALMAS_NUM_REGS; id++) {
unsigned int cf = pmic->config_flags[id];