wls_charge: add status jugdement for state register read

Add status judgment for register reading, If register reading return an
error, we should regard it as status "false".

Change-Id: I6072ac01dcf531256e036bdc9814e0c5f9ffeb14
Reviewed-on: https://gerrit.mot.com/2251647
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
weiweij 2022-04-25 10:11:05 +08:00 • committed by Wei Wei
commit 2fe305b4d6

View file

@ -996,7 +996,12 @@ static int cps_wls_get_state(void)
static bool cps_wls_get_vout_state(void)
{
return !!(cps_wls_get_state() & (1<<6));
int ret = cps_wls_get_state();
if (ret == CPS_WLS_FAIL)
ret = 0;
return !!(ret & (1<<6));
}
static int cps_wls_get_die_tmp(void)