diff options
author | Hans de Goede <hdegoede@redhat.com> | 2017-04-14 21:32:53 +0300 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2017-05-01 13:37:37 +0300 |
commit | ef7fcdaebfce56bd7f1ac3b916b5d587a3666f10 (patch) | |
tree | b672443f05e546317923cf469a416d1e93f6bd88 /drivers/power/supply | |
parent | dcdddda8fdd23048f2eaf54a18a33e9f225d8fb6 (diff) | |
download | linux-ef7fcdaebfce56bd7f1ac3b916b5d587a3666f10.tar.xz |
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: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Diffstat (limited to 'drivers/power/supply')
-rw-r--r-- | drivers/power/supply/max17042_battery.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c index d355ee54b06d..254550038455 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -78,6 +78,7 @@ struct max17042_chip { static enum power_supply_property max17042_battery_props[] = { POWER_SUPPLY_PROP_STATUS, POWER_SUPPLY_PROP_PRESENT, + POWER_SUPPLY_PROP_TECHNOLOGY, POWER_SUPPLY_PROP_CYCLE_COUNT, POWER_SUPPLY_PROP_VOLTAGE_MAX, POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, @@ -238,6 +239,9 @@ static int max17042_get_property(struct power_supply *psy, else val->intval = 1; break; + case POWER_SUPPLY_PROP_TECHNOLOGY: + val->intval = POWER_SUPPLY_TECHNOLOGY_LION; + break; case POWER_SUPPLY_PROP_CYCLE_COUNT: ret = regmap_read(map, MAX17042_Cycles, &data); if (ret < 0) |