power: qpnp-charger: Fix software end of charge conditions

When charging with a charger that cannot supply high currents, the
software EOC algorithm can run into situations where it prematurely
arrives at EOC because the charging current dips below the
termination current.

Fix this by checking the VDD_LOOP_IRQ to make sure we are in constant
voltage range, and making sure there has been three consecutive EOC
counts before declaring EOC.

Change-Id: Idcb31d4ae5bf29c887ab987667d6de205f177a89
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
1 file changed