Re: [PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

Axel Lin
2013-04-15T08:50:51Z

> My understanding is for shared mode regulators:
> It can be in LP mode only when *BOTH* are in LP mode.
> If only one of the regulator in HP mode, then *BOTH* should be in HP mode.
> Did I misunderstand something?

Let me put this issue this way:

Current code behavior:
get_mode() returns IDLE if only one lp_mode_req flag is true, but mode
register value is HP.

AB8540_LDO_ANAMIC1 AB8540_LDO_ANAMIC2 mode register
get_mode() returns
lp_mode_req=true lp_mode_req=true HP
REGULATOR_MODE_NORMAL
lp_mode_req=true lp_mode_req=false HP
REGULATOR_MODE_IDLE
lp_mode_req=false lp_mode_req=true HP
REGULATOR_MODE_IDLE
lp_mode_req=false lp_mode_req=false LP
REGULATOR_MODE_IDLE

with this path:
mode register value is consistent with get_mode().

AB8540_LDO_ANAMIC1 AB8540_LDO_ANAMIC2 mode register
get_mode() returns
lp_mode_req=true lp_mode_req=true HP
REGULATOR_MODE_NORMAL
lp_mode_req=true lp_mode_req=false HP
REGULATOR_MODE_NORMAL
lp_mode_req=false lp_mode_req=true HP
REGULATOR_MODE_NORMAL
lp_mode_req=false lp_mode_req=false LP
REGULATOR_MODE_IDLE