power: smb5: Announce DCIN AICL done via PSY property
Add support for exposing whether or not DCIN AICL process has finished
executing via the DC PSY property AICL_DONE.
AICL is declared as done if there are no error conditions encountered
while doing the work. AICL status is set to not done when DC PSY is
detached, both from the DC plugin handler as well as after determining
DCIN AICL has hit max. The latter case is to address the following edge
case scenario:
1. DCIN AICL work completes normally due to hitting max ICL
2. WLS voltage is decremented after being first incremented by
userspace.
3. DCIN AICL rerun is triggered in 5 sec as a result of the voltage
decrement. (The adaptor is still healthy and so ICL remains still at
max.)
4. WLS detach occurs before expiry of 500 ms in the work, so even though
DC plugin detach path clears AICL done, the DCIN AICL work re-sets it
to done after waking up from the 500 ms sleep.
While at it, change criteria for decrementing DCIN ICL from exact
equality to a minimum check. This will make the logic more robust to any
DCIN UV storms. Also remove stale comment.
Change-Id: I787705ecb874356aa475bb98e6b596a020cc548e
Signed-off-by:
Guru Das Srinagesh <gurus@codeaurora.org>
Loading
Please register or sign in to comment