power: pm8921-bms: fix soc rising from 99% to 100% during discharging

We observed that SoC suddenly increase from 98% or 99% to 100%
right after charger removal. This issue caused by charging adjusting
algorithm which adjust SoC to sync 100% with end of charging.
During charging adjustment, the adjusted SoC could be smaller than
original SoC. So when we remove charger, charging adjusting algorithm
stop adjusting SoC and then bms report original SoC which is larger
than before.

Previously, bms driver considered most of this case by using previous
SoC when SoC increase during discharging. But if SoC is 100%, previous
patch doesn't work.
So this patch add SoC 100% case by checking if charger is enabled.

Change-Id: I70945d391c9d821eaf875f1bcd1e8787077b98da
This commit is contained in:
choongryeol.lee
2013-01-25 16:48:36 -08:00
committed by Iliyan Malchev
parent 491b58e1ca
commit 1819bd4e44
3 changed files with 17 additions and 6 deletions

View File

@@ -291,6 +291,7 @@ int pm8921_usb_ovp_disable(int disable);
int pm8921_get_batt_state(void);
int pm8921_force_start_charging(void);
int pm8921_get_batt_health(void);
int pm8921_is_chg_auto_enable(void);
/**
* pm8921_is_batfet_closed - battery fet status