WLC: when wlc is offline, set psy prop value as 0

When WLC(wireless charge pad) is offline, cps4019 could not
accessed by i2c bus. And we should return the value of 0
to indicate the status of offline. For healthd judgement logic,
it will just distiguish the valud of 0(offline) and non-zero(online).
So it will regards -1 as non-zero(online). As a result, we should
not return non-zero value for psy properties.

Change-Id: I4724d1b4a2d2d607b07fa3b52475e707da55fecf
Reviewed-on: https://gerrit.mot.com/2337171
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
weiweij 2022-07-19 10:37:30 +08:00 • committed by Wei Wei
commit 911ecabe21

View file

@ -1388,7 +1388,7 @@ static int cps_wls_chrg_get_property(struct power_supply *psy,
/*get vbus status first*/
cps_check_power(&low_power_flag);
if (low_power_flag) {
val->intval = -1;
val->intval = 0;
return ret;
}