mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
qpnp-smbcharger-mmi: update ocp check
Charge current ocp overcurrent check was made on negative current Charging is positive polarity, causine ocp cal to be missed NO_PROP_NEEDED: current reports are negative on Olson, not on smith Change-Id: Icfee60ff847b55ff0fe5119cc178fb5fac65d581 Signed-off-by: Bernie Moreno-BERNIEM <berniem@motorola.com> Reviewed-on: https://gerrit.mot.com/1638826 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Ling Jin <lingjin@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
e347ef6e9c
commit
60f7e4400e
1 changed files with 12 additions and 18 deletions
|
|
@ -2627,24 +2627,18 @@ static int mmi_dual_charge_control(struct smb_mmi_charger *chg,
|
|||
else
|
||||
target_fv = flip_p->target_fv;
|
||||
|
||||
if (chg_stat_main.batt_ma < 0) {
|
||||
chg_stat_main.batt_ma *= -1;
|
||||
if (chg_stat_main.batt_ma > main_p->target_fcc) {
|
||||
ocp = chg_stat_main.batt_ma - main_p->target_fcc;
|
||||
main_p->ocp[main_p->pres_temp_zone] += ocp;
|
||||
mmi_info(chg, "Main Exceed by %d mA\n",
|
||||
main_p->ocp[main_p->pres_temp_zone]);
|
||||
}
|
||||
if (chg_stat_main.batt_ma > main_p->target_fcc) {
|
||||
ocp = chg_stat_main.batt_ma - main_p->target_fcc;
|
||||
main_p->ocp[main_p->pres_temp_zone] += ocp;
|
||||
mmi_info(chg, "Main Exceed by %d mA\n",
|
||||
main_p->ocp[main_p->pres_temp_zone]);
|
||||
}
|
||||
|
||||
if (chg_stat_flip.batt_ma < 0) {
|
||||
chg_stat_flip.batt_ma *= -1;
|
||||
if (chg_stat_flip.batt_ma > flip_p->target_fcc) {
|
||||
ocp = chg_stat_flip.batt_ma - flip_p->target_fcc;
|
||||
flip_p->ocp[flip_p->pres_temp_zone] += ocp;
|
||||
mmi_info(chg, "Flip Exceed by %d mA\n",
|
||||
flip_p->ocp[flip_p->pres_temp_zone]);
|
||||
}
|
||||
if (chg_stat_flip.batt_ma > flip_p->target_fcc) {
|
||||
ocp = chg_stat_flip.batt_ma - flip_p->target_fcc;
|
||||
flip_p->ocp[flip_p->pres_temp_zone] += ocp;
|
||||
mmi_info(chg, "Flip Exceed by %d mA\n",
|
||||
flip_p->ocp[flip_p->pres_temp_zone]);
|
||||
}
|
||||
|
||||
target_fcc = main_p->target_fcc + flip_p->target_fcc;
|
||||
|
|
@ -3233,8 +3227,8 @@ static void mmi_heartbeat_work(struct work_struct *work)
|
|||
((report_cap != batt_cap) &&
|
||||
(report_cap <= (batt_cap + MONOTONIC_SOC)) &&
|
||||
(report_cap >= (batt_cap - MONOTONIC_SOC)))) {
|
||||
mmi_info(chip, "Updating Reported Capacity to %d\n",
|
||||
report_cap);
|
||||
mmi_info(chip, "Updating Reported Capacity to %d, main_cap= %d, flip_cap= %d, main_cap_full= %d, flip_cap_full= %d\n",
|
||||
report_cap, main_cap, flip_cap, main_cap_full, flip_cap_full);
|
||||
chip->last_reported_soc = report_cap;
|
||||
}else if ((batt_cap < 100) && (report_cap > (batt_cap + MONOTONIC_SOC))) {
|
||||
chip->last_reported_soc++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue