From a07f15833d787bcbe24092080293301b0b158734 Mon Sep 17 00:00:00 2001 From: litong20 Date: Thu, 25 May 2023 14:40:50 +0800 Subject: [PATCH] cw2217b: modify charging status First unify the polarity of the current through the ibat_polority, then judge the charging state according to the polarity of the current. Change-Id: Ie2c155708e0c6808f56502325af0248e74e6c420 Reviewed-on: https://gerrit.mot.com/2620148 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Yonghua Yan Reviewed-by: Guobin Zhang Submit-Approved: Jira Key --- drivers/power/cw2217b_fg_mmi/cw2217B_fuel_gauge_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/cw2217b_fg_mmi/cw2217B_fuel_gauge_base.c b/drivers/power/cw2217b_fg_mmi/cw2217B_fuel_gauge_base.c index 574c18ba7243..035abbd8e36a 100644 --- a/drivers/power/cw2217b_fg_mmi/cw2217B_fuel_gauge_base.c +++ b/drivers/power/cw2217b_fg_mmi/cw2217B_fuel_gauge_base.c @@ -1071,7 +1071,7 @@ static void cw_get_batt_status(struct cw_battery *cw_bat) cw_bat->batt_status = POWER_SUPPLY_STATUS_FULL; } else if (abs(batt_curr) < CW_CUR_ACCURACY) { cw_bat->batt_status = POWER_SUPPLY_STATUS_NOT_CHARGING; - } else if (batt_curr * cw_bat->ibat_polority < 0) { + } else if (batt_curr > 0) { cw_bat->batt_status = POWER_SUPPLY_STATUS_CHARGING; } else { cw_bat->batt_status = POWER_SUPPLY_STATUS_DISCHARGING;