diff options
| author | Evan Wilson <evan@oliodevices.com> | 2016-03-12 17:14:04 -0800 |
|---|---|---|
| committer | Evan Wilson <evan@oliodevices.com> | 2016-03-24 01:09:58 -0700 |
| commit | f42f33f394d8dc600053a578fbc529cd167edb1d (patch) | |
| tree | 031db8af1ff10dcde38a36f96218db9e15e26cf6 | |
| parent | 29ea916b91c9736d3aefdf035e0996c6117c909b (diff) | |
| download | olio-linux-3.10-f42f33f394d8dc600053a578fbc529cd167edb1d.tar.xz olio-linux-3.10-f42f33f394d8dc600053a578fbc529cd167edb1d.zip | |
Adding a new EXT_SLEEP flag
This flag ensures the regulator is in full ACTIVE mode during sleep
Normally the tps65910 regulators go into an IDLE mode during sleep
Change-Id: I30c0025ee1904ac20fec3ced66041f006658b92c
| -rw-r--r-- | arch/arm/boot/dts/omap3_h1.dts | 2 | ||||
| -rw-r--r-- | drivers/regulator/tps65910-regulator.c | 18 | ||||
| -rw-r--r-- | include/linux/mfd/tps65910.h | 4 |
3 files changed, 18 insertions, 6 deletions
diff --git a/arch/arm/boot/dts/omap3_h1.dts b/arch/arm/boot/dts/omap3_h1.dts index 46c6e2d97b1..eb77ae21854 100644 --- a/arch/arm/boot/dts/omap3_h1.dts +++ b/arch/arm/boot/dts/omap3_h1.dts @@ -429,7 +429,7 @@ dev_pins: pinmux_pv_pins { regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-always-on; - /* ti,regulator-ext-sleep-control = <8>; */ + ti,regulator-ext-sleep-control = <0x10>; }; /* This one goes to both SPI (for DSS) and touch. How can I diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c index 035eb750e28..46e5f663151 100644 --- a/drivers/regulator/tps65910-regulator.c +++ b/drivers/regulator/tps65910-regulator.c @@ -29,7 +29,8 @@ #define EXT_SLEEP_CONTROL (TPS65910_SLEEP_CONTROL_EXT_INPUT_EN1 | \ TPS65910_SLEEP_CONTROL_EXT_INPUT_EN2 | \ TPS65910_SLEEP_CONTROL_EXT_INPUT_EN3 | \ - TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP) + TPS65910_SLEEP_CONTROL_EXT_INPUT_SLEEP | \ + TPS65910_SLEEP_CONTROL_EXT_INPUT_ACTIVE) /* supported VIO voltages in microvolts */ static const unsigned int VIO_VSEL_table[] = { @@ -389,6 +390,7 @@ static int tps65910_set_mode(struct regulator_dev *dev, unsigned int mode) return reg; switch (mode) { + dev_info(&(dev->dev), "Setting regulator: %d to mode: %d", reg, mode); case REGULATOR_MODE_NORMAL: return tps65910_reg_update_bits(pmic->mfd, reg, LDO_ST_MODE_BIT | LDO_ST_ON_BIT, @@ -408,6 +410,7 @@ static unsigned int tps65910_get_mode(struct regulator_dev *dev) struct tps65910_reg *pmic = rdev_get_drvdata(dev); int ret, reg, value, id = rdev_get_id(dev); + dev_info(&(dev->dev), "Getting mode for regulator: %d", reg); reg = pmic->get_ctrl_reg(id); if (reg < 0) return reg; @@ -807,7 +810,9 @@ static int tps65910_set_ext_sleep_config(struct tps65910_reg *pmic, en_count += ((ext_sleep_config & TPS65910_SLEEP_CONTROL_EXT_INPUT_EN3) != 0); en_count += ((ext_sleep_config & - TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP) != 0); + TPS65910_SLEEP_CONTROL_EXT_INPUT_SLEEP) != 0); + en_count += ((ext_sleep_config & + TPS65910_SLEEP_CONTROL_EXT_INPUT_ACTIVE) != 0); if (en_count > 1) { dev_err(mfd->dev, "External sleep control flag is not proper\n"); @@ -911,10 +916,15 @@ static int tps65910_set_ext_sleep_config(struct tps65910_reg *pmic, } } - ret = tps65910_reg_clear_bits(mfd, + if (ext_sleep_config & TPS65910_SLEEP_CONTROL_EXT_INPUT_ACTIVE) { + ret = tps65910_reg_set_bits(mfd, + TPS65910_SLEEP_KEEP_LDO_ON + regoffs, bit_pos); + } else { + ret = tps65910_reg_clear_bits(mfd, TPS65910_SLEEP_KEEP_LDO_ON + regoffs, bit_pos); + } if (!ret) { - if (ext_sleep_config & TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP) + if (ext_sleep_config & TPS65910_SLEEP_CONTROL_EXT_INPUT_SLEEP) ret = tps65910_reg_set_bits(mfd, TPS65910_SLEEP_SET_LDO_OFF + regoffs, bit_pos); else diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h index 7f0ec4340a3..e4d5b2b8ce8 100644 --- a/include/linux/mfd/tps65910.h +++ b/include/linux/mfd/tps65910.h @@ -851,7 +851,9 @@ #define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN1 0x1 #define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN2 0x2 #define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN3 0x4 -#define TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP 0x8 +#define TPS65910_SLEEP_CONTROL_EXT_INPUT_SLEEP 0x8 +/* Keep the regulator fully active during sleep. Normally the regulator will go into an idle mode. */ +#define TPS65910_SLEEP_CONTROL_EXT_INPUT_ACTIVE 0x10 /* * Sleep keepon data: Maintains the state in sleep mode |