Commit 58599393 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: Fix the logic of tps65910_get_mode

We actually clear LDO_ST_ON_BIT for standby mode in tps65910_set_mode.
Fix the logic in tps65910_get_mode.

Supply state (EEPROM bits):
ST[1:0] = 00 : Off
ST[1:0] = 01 : On high power (ACTIVE)
ST[1:0] = 10 : Off
ST[1:0] = 11 : On low power (SLEEP)
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent fc56911b
...@@ -520,7 +520,7 @@ static unsigned int tps65910_get_mode(struct regulator_dev *dev) ...@@ -520,7 +520,7 @@ static unsigned int tps65910_get_mode(struct regulator_dev *dev)
if (value < 0) if (value < 0)
return value; return value;
if (value & LDO_ST_ON_BIT) if (!(value & LDO_ST_ON_BIT))
return REGULATOR_MODE_STANDBY; return REGULATOR_MODE_STANDBY;
else if (value & LDO_ST_MODE_BIT) else if (value & LDO_ST_MODE_BIT)
return REGULATOR_MODE_IDLE; return REGULATOR_MODE_IDLE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment