From 4e65fc6b52ec3331132011042a040152391cd38d Mon Sep 17 00:00:00 2001 From: Keunho Hwang Date: Fri, 28 Sep 2018 10:29:52 +0900 Subject: [PATCH] [9610] drviers: battery: Add sysfs for VTS/CTS Change-Id: I41384302c5721cd78e6423aaac99d70dc81fe381 Signed-off-by: Keunho Hwang --- drivers/power/supply/s2mu00x_battery.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/power/supply/s2mu00x_battery.c b/drivers/power/supply/s2mu00x_battery.c index 2e63894c2b6c..fbf2b760af33 100644 --- a/drivers/power/supply/s2mu00x_battery.c +++ b/drivers/power/supply/s2mu00x_battery.c @@ -74,6 +74,10 @@ static enum power_supply_property s2mu00x_battery_props[] = { POWER_SUPPLY_PROP_TEMP, POWER_SUPPLY_PROP_CHARGE_NOW, POWER_SUPPLY_PROP_CAPACITY, + POWER_SUPPLY_PROP_CURRENT_NOW, + POWER_SUPPLY_PROP_CURRENT_AVG, + POWER_SUPPLY_PROP_CHARGE_COUNTER, + POWER_SUPPLY_PROP_CHARGE_FULL, }; static enum power_supply_property s2mu00x_power_props[] = { @@ -429,6 +433,18 @@ static int s2mu00x_battery_get_property(struct power_supply *psy, val->intval = battery->capacity; } break; + case POWER_SUPPLY_PROP_CURRENT_NOW: + val->intval = battery->current_now; + break; + case POWER_SUPPLY_PROP_CURRENT_AVG: + val->intval = battery->current_avg; + break; + case POWER_SUPPLY_PROP_CHARGE_COUNTER: + val->intval = battery->full_check_cnt + 1; + break; + case POWER_SUPPLY_PROP_CHARGE_FULL: + val->intval = 100; + break; default: ret = -ENODATA; } -- 2.20.1