Skip to content

Commit

Permalink
regulator: Fix the logic of tps65910_get_mode
Browse files Browse the repository at this point in the history
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: Axel Lin <axel.lin@gmail.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Mar 13, 2012
1 parent fc56911 commit 5859939
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/tps65910-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ static unsigned int tps65910_get_mode(struct regulator_dev *dev)
if (value < 0)
return value;

if (value & LDO_ST_ON_BIT)
if (!(value & LDO_ST_ON_BIT))
return REGULATOR_MODE_STANDBY;
else if (value & LDO_ST_MODE_BIT)
return REGULATOR_MODE_IDLE;
Expand Down

0 comments on commit 5859939

Please sign in to comment.