summaryrefslogtreecommitdiff
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2013-04-18 18:32:48 +0530
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-18 18:23:53 +0100
commit51d3a0c999e18a802a654171b5e05952b4630148 (patch)
tree4ddc1594d7f4d132d40b6e3adf62892ba01eb2cc /include/linux/mfd
parent28d1e8cd671a53d6b4f967abbbc2a55f7bd333f6 (diff)
regulator: palmas: preserve modes of rails during enable/disable
The Palma device like TPS65913 have the mode mask which is also used for enable/disable the rails. The mode bits are defined as 00: OFF 01: AUTO 10: ECO 11: Forced PWM and modes are set accordingly as REGULATOR_MODE_NORMAL: AUTO REGULATOR_MODE_IDLE: ECO REGULATOR_MODE_FAST: PWM Two issue observed: 1. If client calls following sequence: regulator_enable(), regulator_set_mode(FAST), regulator_disable() and again the regulator_enable() then the mode is reset to NORMAL inplace of keeping the mode as FAST. Fixing this by storing the current mode configured by client and restoring modes when enable() is called after disable(). 2. In following sequence, the regulator get enabled: regulator_disable() regulator_set_mode(FAST), Fixing this by updating new mode in register only if it is enabled. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/palmas.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index a58c579e8cf4..e971a7c81b79 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -327,6 +327,7 @@ struct palmas_pmic {
int range[PALMAS_REG_SMPS10];
unsigned int ramp_delay[PALMAS_REG_SMPS10];
+ unsigned int current_reg_mode[PALMAS_REG_SMPS10];
};
struct palmas_resource {