{
u8 rsoc = di->rsoc;
u8 dsoc = di->dsoc;
- u8 status = di->psy_status;
u8 cnt;
int unit_time;
int smooth_time;
__func__, cnt, unit_time, smooth_time,
BASE_TO_SEC(di->power_on_base), dsoc, rsoc);
- if ((status == POWER_SUPPLY_STATUS_CHARGING) ||
- (status == POWER_SUPPLY_STATUS_FULL && abs(di->current_avg) < 5)) {
+ if (di->current_avg >= 0 || di->chrg_status == CHARGE_FINISH) {
DBG("chrg, sm:%d, aim:%d\n", smooth_time, unit_time * 3 / 5);
if ((dsoc < rsoc - 1) && (smooth_time > unit_time * 3 / 5)) {
cnt = 0;
dsoc = 100;
rk81x_bat_save_dsoc(di, dsoc);
}
- } else {/*status == POWER_SUPPLY_STATUS_DISCHARGING*/
-
- DBG("dischrg, sm:%d, aim:%d\n", smooth_time, unit_time * 3/5);
- if ((dsoc > rsoc) && (smooth_time > unit_time * 3/5)) {
+ } else {
+ DBG("dischrg, sm:%d, aim:%d\n", smooth_time, unit_time * 3 / 5);
+ if ((dsoc > rsoc) && (smooth_time > unit_time * 3 / 5)) {
cnt = 0;
dsoc--;
if (dsoc <= 0)