power: qpnp-smbcharger: introduce voter for hw_aicl
There are multiple callsites which end up enabling/disabling
the aicl reruns. Encapsulating the control via a votable object
would be a good cleanup.
There are only three voters, one of which, weak charger, acts
as an override to disable aicl reruns regardless of the votes
from others. This overriding behaviour needs to be modelled using a
cascaded voting scheme i.e. create two votables, an enable votable
where all the enabling clients vote and a disable votable where
weak charger and the enable votable cast their vote. Both the enable
and disable votable need to be "SET_ANY" votable types since they
are acting on boolean votes.
VARB_WORKAROUND DEFAULT_CONFIG
| |
| |
| |
V V
Enable_Indirect_Votable Weak_Charger
| |
| |
| |
V V
----Disable_Votable-----------
|
|
|
V
hw_register
Also there are couple of places, dcin_uv_handler() and
handle_usb_removal(), where aicl is re-enabled after the deglitch
workaround was called. This was likely done to ensure that the
reruns were enabled in case if the deglitch workaround disabled it.
With the introduction of votable object this can be cleanly handled.
Remove such code.
CRs-Fixed: 948903
Change-Id: I5a22f05ed4e04ed71e79da8566f521b66b749134
Signed-off-by:
Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Loading
Please register or sign in to comment