@@ -532,6 +532,7 @@ static enum power_supply_property cpcap_battery_props[] = {
POWER_SUPPLY_PROP_CURRENT_AVG,
POWER_SUPPLY_PROP_CURRENT_NOW,
POWER_SUPPLY_PROP_CHARGE_FULL,
+ POWER_SUPPLY_PROP_CHARGE_NOW,
POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
POWER_SUPPLY_PROP_CHARGE_COUNTER,
POWER_SUPPLY_PROP_POWER_NOW,
@@ -651,6 +652,12 @@ static int cpcap_battery_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_CAPACITY_LEVEL:
val->intval = cpcap_battery_get_rough_capacity(ddata);
break;
+ case POWER_SUPPLY_PROP_CHARGE_NOW:
+ low = cpcap_battery_get_lowest(ddata);
+ if (!low->voltage)
+ return -ENODATA;
+ val->intval = low->counter_uah - latest->counter_uah;
+ break;
case POWER_SUPPLY_PROP_CHARGE_FULL:
if (!ddata->charge_full)
return -ENODATA;
Add charge_now property. Signed-off-by: Arthur Demchenkov <spinal.by@gmail.com> --- drivers/power/supply/cpcap-battery.c | 7 +++++++ 1 file changed, 7 insertions(+)