summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2017-04-14 20:32:54 +0200
committerSebastian Reichel <sre@kernel.org>2017-05-01 12:37:42 +0200
commit7bfc9397ff9690fbb0da44e1a0aeab953cb73b77 (patch)
treeb22e2d7ecbeabfbb19bd06fcf9e1d12f104d41ff /drivers/power/supply
parentef7fcdaebfce56bd7f1ac3b916b5d587a3666f10 (diff)
downloadblackbird-op-linux-7bfc9397ff9690fbb0da44e1a0aeab953cb73b77.tar.gz
blackbird-op-linux-7bfc9397ff9690fbb0da44e1a0aeab953cb73b77.zip
power: supply: max17042_battery: Add support for the VOLT_MIN property
The info is there, so lets export it, like we already do for VOLT_MAX. 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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
index 254550038455..0e94349b3855 100644
--- a/drivers/power/supply/max17042_battery.c
+++ b/drivers/power/supply/max17042_battery.c
@@ -81,6 +81,7 @@ static enum power_supply_property max17042_battery_props[] = {
POWER_SUPPLY_PROP_TECHNOLOGY,
POWER_SUPPLY_PROP_CYCLE_COUNT,
POWER_SUPPLY_PROP_VOLTAGE_MAX,
+ POWER_SUPPLY_PROP_VOLTAGE_MIN,
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
POWER_SUPPLY_PROP_VOLTAGE_NOW,
POWER_SUPPLY_PROP_VOLTAGE_AVG,
@@ -257,6 +258,13 @@ static int max17042_get_property(struct power_supply *psy,
val->intval = data >> 8;
val->intval *= 20000; /* Units of LSB = 20mV */
break;
+ case POWER_SUPPLY_PROP_VOLTAGE_MIN:
+ ret = regmap_read(map, MAX17042_MinMaxVolt, &data);
+ if (ret < 0)
+ return ret;
+
+ val->intval = (data & 0xff) * 20000; /* Units of 20mV */
+ break;
case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
if (chip->chip_type == MAXIM_DEVICE_TYPE_MAX17042)
ret = regmap_read(map, MAX17042_V_empty, &data);
OpenPOWER on IntegriCloud