power: vm_bms: Add a logic to manage SOC reporting after EOC
There is a possibility that SOC(state of charge) drops quickly after
EOC(end-of-charge) leading to frequent recharge, which may be undesirable.
To manage SOC reporting after EOC with the below logic.
1. If charged to full, begin reported_soc process and report 100 soc.
2. If charger is not removed after full, keep reported_soc to 100.
3. If charger is removed, use a timer to decrease the reported_soc
to the real soc.
4. If charger is reinserted, clean the timer and keep the reported_soc
not changed until the real soc reaches the reported_soc.
5. If reported_soc equals to real soc, stop reported_soc logic and report
the real soc.
6. If the delta between reported_soc and real soc is larger than a
threshold, enter reported_soc high current mode and force to use a
timer to decrease the reported_soc(same as logic 3).
7. If reported_soc is 100, do not send the DISCHARGING status to charger
until it drops to 99.
Change-Id: If56a440f382ef8a86f129c5f2f89f8b156820202
Signed-off-by:
Jie Cheng <rockiec@codeaurora.org>
Loading
Please register or sign in to comment