From 911ecabe215fcf5e144bdeb268dc85f6e97f7e41 Mon Sep 17 00:00:00 2001 From: weiweij Date: Tue, 19 Jul 2022 10:37:30 +0800 Subject: [PATCH] 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 Submit-Approved: Jira Key --- drivers/power/cps4019_wls_charger/cps4019_wls_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/cps4019_wls_charger/cps4019_wls_charger.c b/drivers/power/cps4019_wls_charger/cps4019_wls_charger.c index 75f3469b8369..1d4329d005f6 100644 --- a/drivers/power/cps4019_wls_charger/cps4019_wls_charger.c +++ b/drivers/power/cps4019_wls_charger/cps4019_wls_charger.c @@ -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; }