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 <xuxj12@motorola.com>
Reviewed-on: https://gerrit.mot.com/2389294
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
xuxj12 2022-09-22 17:38:19 +08:00
commit 32040dee63

View file

@ -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,