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

From: Axel Lin
Date: Mon Apr 15 2013 - 04:50:53 EST


> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/