msm: gdsc: Use regulator framework to enforce HW trigger support
For GDSC that does not support hardware trigger, we do not allow mode
change to happen. Even though we enforce this through an internal
flag, we still set REGULATOR_CHANGE_MODE when registering with
regulator framework. This results in probe messages that indicate
change mode support incorrectly.
We should simply use regulator framework to enforce the behavior
instead of using an internal flag. The resulting behavior is same as
our internal flag, except when GDSC does not have hardware trigger
support but get_mode is called. Previously we return MODE_NORMAL
without querying register state. Now we will read the register and
return the actual state hardware is in. It's safe because the register
bit is always there no matter hardware trigger support is present or
not. The resulting value is same MODE_NORMAL because regulator
framework rejects all set_mode calls on that GDSC, leaving that bit
at default value, MODE_NORMAL.
Change-Id: I3f3f278ac19c6034bfe46dcdfd14ed78fb9129dd
Signed-off-by:
Junjie Wu <junjiew@codeaurora.org>
Loading
Please register or sign in to comment