From 32040dee633684dbfa9eb36d6f5b1b509f704c45 Mon Sep 17 00:00:00 2001 From: xuxj12 Date: Thu, 22 Sep 2022 17:38:19 +0800 Subject: [PATCH] add property voltage_ocv voltage_ocv is not support on this FG, but tcmd test need it, add this property and retrun voltage_now instead Change-Id: Iae588f9f0093ddd4eea77e2a173117d4f64a1b04 Signed-off-by: xuxj12 Reviewed-on: https://gerrit.mot.com/2389294 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Yonghua Yan Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- drivers/power/cw2217b_fg_mmi/cw2217B_fuel_gauge_base.c | 5 +++++ 1 file changed, 5 insertions(+) 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 d1f4f9a0321e..fbf5ee839c0c 100644 --- a/drivers/power/cw2217b_fg_mmi/cw2217B_fuel_gauge_base.c +++ b/drivers/power/cw2217b_fg_mmi/cw2217B_fuel_gauge_base.c @@ -947,6 +947,10 @@ static int cw_battery_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_VOLTAGE_NOW: val->intval = cw_bat->voltage * CW_VOL_UNIT; break; + case POWER_SUPPLY_PROP_VOLTAGE_OCV: + /* voltage_ocv invalid, use voltage_now instead*/ + val->intval = cw_bat->voltage * CW_VOL_UNIT; + break; case POWER_SUPPLY_PROP_CURRENT_NOW: cw_get_current(cw_bat); val->intval = cw_bat->cw_current * CW_CUR_UNIT * (-1); @@ -981,6 +985,7 @@ static enum power_supply_property cw_battery_properties[] = { POWER_SUPPLY_PROP_HEALTH, POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_VOLTAGE_NOW, + POWER_SUPPLY_PROP_VOLTAGE_OCV, POWER_SUPPLY_PROP_CURRENT_NOW, POWER_SUPPLY_PROP_TECHNOLOGY, POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,