charge: Skip AICL when usb /charger cable is not connected

The prerequisite for AICL is that VBUS is required,
so when  usb or charger cable is not connected
(neither usbin nor dcin exists),
we need to skip re-run AICL.

Change-Id: I2d039fbfaa090ac3e7682e4ddb9889a278503484
Signed-off-by: Guocheng Wang <wanggc6@motorola.com>
Reviewed-on: https://gerrit.mot.com/2760500
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wei Wei <weiweij@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Guocheng Wang 2023-10-07 17:07:24 +08:00 • committed by Xiaojun Ji
commit b593dc6aee

View file

@ -2654,6 +2654,10 @@ int smblib_run_aicl(struct smb_charger *chg, int type)
if (stat & USBIN_SUSPEND_STS_BIT)
return rc;
/* Neither usbin nor dcin exists so skip re-running AICL */
if (!(stat & (USE_USBIN_BIT | USE_DCIN_BIT)))
return rc;
smblib_dbg(chg, PR_MISC, "re-running AICL\n");
stat = (type == RERUN_AICL) ? RERUN_AICL_BIT : RESTART_AICL_BIT;