power: pmic-voter: handle scenarios where voter state is invalid
After the voter is initialized and before the first valid vote
is made, the voter state is invalid. Introduce some changes to
accommodate this state:
1. Initialize effective_result and all client states to -EINVAL.
2. If the current vote does not change effective_result, or if
there are no valid votes in the array, skip the callback and
maintain the current effective result.
3. Allow the user to provide a default_value, which is returned
in the scenario where the effective_result is queried before
making a valid vote.
CRs-Fixed: 927044
Change-Id: Ic00064d95e5a9234bcf44a415ad2bbff6e84a2f3
Signed-off-by:
Nicholas Troast <ntroast@codeaurora.org>
Loading
Please register or sign in to comment