From aa07f02793ec149d560142f25af0243fff84208b Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Wed, 17 Apr 2013 15:13:12 +0530 Subject: regulator: palmas: support for external regulator through control outputs Palmas device have control outputs like REGEN1, REGEN2, REGEN3, SYSEN1 and SYSEN2. These control outputs can be used for controlling external voltage switches to enabled/disable voltage outputs. Add support of these control outputs through regulator framework. Signed-off-by: Laxman Dewangan Signed-off-by: Mark Brown --- include/linux/mfd/palmas.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux/mfd') diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index a4d13d7cd001..44256aa7b46a 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h @@ -154,6 +154,12 @@ enum palmas_regulators { PALMAS_REG_LDO9, PALMAS_REG_LDOLN, PALMAS_REG_LDOUSB, + /* External regulators */ + PALMAS_REG_REGEN1, + PALMAS_REG_REGEN2, + PALMAS_REG_REGEN3, + PALMAS_REG_SYSEN1, + PALMAS_REG_SYSEN2, /* Total number of regulators */ PALMAS_NUM_REGS, }; -- cgit v1.2.3 From 17c11a7603496949989ed286ed218a9e645b6259 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Wed, 17 Apr 2013 15:13:13 +0530 Subject: regulator: palmas: add support for LDO8 tracking mode LDO8 of Palma device like tps65913 support the tracking mode on which LDO8 track the SMPS45 voltage when SMPS45 is ON and use the LDO8.VOLTAGE_SEL register when SMPS45 is OFF. On track mode, the steps of voltage change for LDO8 is 25mV where in non-tracking mode it is 50mV. Set the steps accordingly. Number of voltage count is still same for both the cases. Signed-off-by: Laxman Dewangan Acked-by: Graeme Gregory Signed-off-by: Mark Brown --- include/linux/mfd/palmas.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/linux/mfd') diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 44256aa7b46a..10daa8c1e73c 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h @@ -177,6 +177,9 @@ struct palmas_pmic_platform_data { /* use LDO6 for vibrator control */ int ldo6_vibrator; + + /* Enable tracking mode of LDO8 */ + bool enable_ldo8_tracking; }; struct palmas_usb_platform_data { -- cgit v1.2.3 From 28d1e8cd671a53d6b4f967abbbc2a55f7bd333f6 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Thu, 18 Apr 2013 18:32:47 +0530 Subject: regulator: palma: add ramp delay support through regulator constraints Currently Palma regulator driver support the ramp delay through rail specific platform data. As regulator framework support the configuration of ramp delay through regulator constraint, using the framework method and removing the platform specific data approach. Signed-off-by: Laxman Dewangan Acked-by: Graeme Gregory Signed-off-by: Mark Brown --- include/linux/mfd/palmas.h | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'include/linux/mfd') diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 10daa8c1e73c..a58c579e8cf4 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h @@ -109,19 +109,6 @@ struct palmas_reg_init { */ int mode_sleep; - /* tstep is the timestep loaded to the TSTEP register - * - * For SMPS - * - * 0: Jump (no slope control) - * 1: 10mV/us - * 2: 5mV/us - * 3: 2.5mV/us - * - * For LDO unused - */ - int tstep; - /* voltage_sel is the bitfield loaded onto the SMPSX_VOLTAGE * register. Set this is the default voltage set in OTP needs * to be overridden. @@ -339,6 +326,7 @@ struct palmas_pmic { int smps457; int range[PALMAS_REG_SMPS10]; + unsigned int ramp_delay[PALMAS_REG_SMPS10]; }; struct palmas_resource { -- cgit v1.2.3 From 51d3a0c999e18a802a654171b5e05952b4630148 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Thu, 18 Apr 2013 18:32:48 +0530 Subject: 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 Acked-by: Graeme Gregory Signed-off-by: Mark Brown --- include/linux/mfd/palmas.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux/mfd') 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 { -- cgit v1.2.3