提交 ef7fcdae 编写于 作者: H Hans de Goede 提交者: Sebastian Reichel

power: supply: max17042_battery: Add support for the TECHNOLOGY attribute

The max17042 is intended for Li-Ion or Li-Po batteries, add a TECHNOLOGY
attribute to reflect this. Note this is hardcoded to Li-Ion as there is
no way to tell the difference, and Lithium-Ion Polymer batteries are
a sub-family of Lithium-Ion so Li-Ion technically is correct for both.

Using Li-Ion for both is already done by many drivers and is much
better then not providing any technology info at all.
Suggested-by: NWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
Signed-off-by: NHans de Goede <hdegoede@redhat.com>
Reviewed-by: NKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
上级 dcdddda8
...@@ -78,6 +78,7 @@ struct max17042_chip { ...@@ -78,6 +78,7 @@ struct max17042_chip {
static enum power_supply_property max17042_battery_props[] = { static enum power_supply_property max17042_battery_props[] = {
POWER_SUPPLY_PROP_STATUS, POWER_SUPPLY_PROP_STATUS,
POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_PRESENT,
POWER_SUPPLY_PROP_TECHNOLOGY,
POWER_SUPPLY_PROP_CYCLE_COUNT, POWER_SUPPLY_PROP_CYCLE_COUNT,
POWER_SUPPLY_PROP_VOLTAGE_MAX, POWER_SUPPLY_PROP_VOLTAGE_MAX,
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
...@@ -238,6 +239,9 @@ static int max17042_get_property(struct power_supply *psy, ...@@ -238,6 +239,9 @@ static int max17042_get_property(struct power_supply *psy,
else else
val->intval = 1; val->intval = 1;
break; break;
case POWER_SUPPLY_PROP_TECHNOLOGY:
val->intval = POWER_SUPPLY_TECHNOLOGY_LION;
break;
case POWER_SUPPLY_PROP_CYCLE_COUNT: case POWER_SUPPLY_PROP_CYCLE_COUNT:
ret = regmap_read(map, MAX17042_Cycles, &data); ret = regmap_read(map, MAX17042_Cycles, &data);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册