Skip to content

Commit 7cff19b

Browse files
Yuanjiang Yusre
authored andcommitted
power: supply: sc27xx: Add POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN attribute
Add POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN attribute to provide the battery's design capacity for charger manager to calculate the charging counter. Signed-off-by: Yuanjiang Yu <[email protected]> Signed-off-by: Baolin Wang <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 343160e commit 7cff19b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/power/supply/sc27xx_fuel_gauge.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,10 @@ static int sc27xx_fgu_get_property(struct power_supply *psy,
587587
val->intval = value * 1000;
588588
break;
589589

590+
case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
591+
val->intval = data->total_cap * 1000;
592+
break;
593+
590594
default:
591595
ret = -EINVAL;
592596
break;
@@ -644,6 +648,7 @@ static enum power_supply_property sc27xx_fgu_props[] = {
644648
POWER_SUPPLY_PROP_CURRENT_NOW,
645649
POWER_SUPPLY_PROP_CURRENT_AVG,
646650
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
651+
POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
647652
};
648653

649654
static const struct power_supply_desc sc27xx_fgu_desc = {

0 commit comments

Comments
 (0)