power: qpnp-smbcharger-mmi: Wait for FG Ready

IF the Max FG report -EAGAIN then it has not completed
the init of the battery profile and values could be
inaccurate.  So stop processing and reschedule heartbeat
if this is seen so a fresh 1st run of data can be taken.

Change-Id: I2070ba9e90338b7eb2ba8eb4f395739170810012
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1376495
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Cesar Augusto Marcelino dos Santos <cmsantos@motorola.com>
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Kenny Kessler 2019-06-25 10:00:38 -05:00 • committed by Kenneth Kessler
commit fefaa0821c

View file

@ -2706,6 +2706,12 @@ static void mmi_heartbeat_work(struct work_struct *work)
} else
flip_cap_full = pval.intval;
if (cap_err == -EAGAIN) {
mmi_err(chip, "SMBMMI: The FGs are not ready yet\n");
hb_resch_time = HEARTBEAT_DUAL_DELAY_MS;
goto sch_hb;
}
report_cap = main_cap * main_cap_full;
report_cap += flip_cap * flip_cap_full;
report_cap /= main_cap_full + flip_cap_full;