Commit 8720b255 authored by Yuanjiang Yu's avatar Yuanjiang Yu Committed by Sebastian Reichel

power: supply: sc27xx: Allow to change the battery full capacity

The battery full capacity can be affected by the temperature or the
servicing time or other factors, so some platforms will track the
real battery full capacity in charger manager service. Thus we should
allow to change the battery full capacity by setting the
'POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN' property as writeable.
Signed-off-by: default avatarYuanjiang Yu <yuanjiang.yu@unisoc.com>
Signed-off-by: default avatarBaolin Wang <baolin.wang7@gmail.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent f3912a5d
...@@ -656,6 +656,11 @@ static int sc27xx_fgu_set_property(struct power_supply *psy, ...@@ -656,6 +656,11 @@ static int sc27xx_fgu_set_property(struct power_supply *psy,
ret = 0; ret = 0;
break; break;
case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
data->total_cap = val->intval / 1000;
ret = 0;
break;
default: default:
ret = -EINVAL; ret = -EINVAL;
} }
...@@ -676,7 +681,8 @@ static int sc27xx_fgu_property_is_writeable(struct power_supply *psy, ...@@ -676,7 +681,8 @@ static int sc27xx_fgu_property_is_writeable(struct power_supply *psy,
enum power_supply_property psp) enum power_supply_property psp)
{ {
return psp == POWER_SUPPLY_PROP_CAPACITY || return psp == POWER_SUPPLY_PROP_CAPACITY ||
psp == POWER_SUPPLY_PROP_CALIBRATE; psp == POWER_SUPPLY_PROP_CALIBRATE ||
psp == POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN;
} }
static enum power_supply_property sc27xx_fgu_props[] = { static enum power_supply_property sc27xx_fgu_props[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment