mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
power: qpnp-smbcharger-mmi:Fix reported capacity update
On Some units battery capacity and MONOTONIC_SOC values seems to be less than the reported capacity. In this case reported capacity will not get updated until the unit is rebooted. Change-Id: Ibfcaf31509e4e0d987e620f9896b66a70544689d Reviewed-on: https://gerrit.mot.com/1315042 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Kenneth Kessler <kennykessler@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
0015b868ee
commit
1b3dfa3d61
1 changed files with 8 additions and 0 deletions
|
|
@ -2272,6 +2272,14 @@ static void mmi_heartbeat_work(struct work_struct *work)
|
|||
pr_info("SMBMMI: Updating Reported Capacity to %d\n",
|
||||
report_cap);
|
||||
chip->last_reported_soc = report_cap;
|
||||
}else if ((batt_cap < 100) && (report_cap > (batt_cap + MONOTONIC_SOC))) {
|
||||
chip->last_reported_soc++;
|
||||
pr_info("SMBMMI: Alter Up Reported Capacity to %d target %d\n",
|
||||
chip->last_reported_soc, report_cap);
|
||||
}else if ((batt_cap > 0) && (report_cap < (batt_cap - MONOTONIC_SOC))) {
|
||||
chip->last_reported_soc--;
|
||||
pr_info("SMBMMI: Alter Down Reported Capacity to %d target %d\n",
|
||||
chip->last_reported_soc, report_cap);
|
||||
}
|
||||
|
||||
/* Dual Step and Thermal Charging */
|
||||
|
|
|
|||
Loading…
Reference in a new issue