mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 00:00:00 -04:00
Flip sign of current during taper check
On Smith, charging current is positive and discharging current is negative. The flipped sign would always report discharging, so the current would always report as tapered. Change-Id: Ia2b93a1e943d20a52956e6068acae879d1934a8d Reviewed-on: https://gerrit.mot.com/1731691 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Ling Jin <lingjin@motorola.com> Submit-Approved: Jira Key Reviewed-by: Bernie Moreno <berniem@motorola.com>
This commit is contained in:
parent
53da186cbb
commit
075b3e8095
1 changed files with 6 additions and 7 deletions
|
|
@ -2248,7 +2248,12 @@ static bool mmi_has_current_tapered(int batt, struct smb_mmi_charger *chg,
|
|||
target_ma = allowed_fcc - TAPER_DROP_MA;
|
||||
|
||||
if (batt_ma < 0) {
|
||||
batt_ma *= -1;
|
||||
if (chip->chrg_taper_cnt >= TAPER_COUNT) {
|
||||
change_state = true;
|
||||
chip->chrg_taper_cnt = 0;
|
||||
} else
|
||||
chip->chrg_taper_cnt++;
|
||||
} else {
|
||||
if (batt_ma <= target_ma)
|
||||
if (chip->chrg_taper_cnt >= TAPER_COUNT) {
|
||||
change_state = true;
|
||||
|
|
@ -2257,12 +2262,6 @@ static bool mmi_has_current_tapered(int batt, struct smb_mmi_charger *chg,
|
|||
chip->chrg_taper_cnt++;
|
||||
else
|
||||
chip->chrg_taper_cnt = 0;
|
||||
} else {
|
||||
if (chip->chrg_taper_cnt >= TAPER_COUNT) {
|
||||
change_state = true;
|
||||
chip->chrg_taper_cnt = 0;
|
||||
} else
|
||||
chip->chrg_taper_cnt++;
|
||||
}
|
||||
|
||||
return change_state;
|
||||
|
|
|
|||
Loading…
Reference in a new issue