[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <a48b8acd5111120e3effe71e05d5f8166470f725.1564566425.git.baolin.wang@linaro.org>
Date: Wed, 31 Jul 2019 18:00:23 +0800
From: Baolin Wang <baolin.wang@...aro.org>
To: sre@...nel.org
Cc: orsonzhai@...il.com, zhang.lyra@...il.com, yuanjiang.yu@...soc.com,
baolin.wang@...aro.org, vincent.guittot@...aro.org,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/6] power: supply: sc27xx: Add POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN attribute
From: Yuanjiang Yu <yuanjiang.yu@...soc.com>
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 <yuanjiang.yu@...soc.com>
Signed-off-by: Baolin Wang <baolin.wang@...aro.org>
---
drivers/power/supply/sc27xx_fuel_gauge.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c
index 24895cc..2fe97ae 100644
--- a/drivers/power/supply/sc27xx_fuel_gauge.c
+++ b/drivers/power/supply/sc27xx_fuel_gauge.c
@@ -587,6 +587,10 @@ static int sc27xx_fgu_get_property(struct power_supply *psy,
val->intval = value * 1000;
break;
+ case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
+ val->intval = data->total_cap * 1000;
+ break;
+
default:
ret = -EINVAL;
break;
@@ -644,6 +648,7 @@ static int sc27xx_fgu_property_is_writeable(struct power_supply *psy,
POWER_SUPPLY_PROP_CURRENT_NOW,
POWER_SUPPLY_PROP_CURRENT_AVG,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
+ POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
};
static const struct power_supply_desc sc27xx_fgu_desc = {
--
1.7.9.5
Powered by blists - more mailing lists