aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2017-04-14 14:32:58 -0400
committerSebastian Reichel <sre@kernel.org>2017-05-01 06:37:58 -0400
commitadb69a3c4524693a32ba72533ee6d7a52e54989e (patch)
tree90c595b4fd67a38caf5862cacf8bbc4f668f7681 /drivers
parent6d6b61eafca94146cedf7709974a7423df16a6f1 (diff)
power: supply: max17042_battery: Add support for the SCOPE property
Add support for the SCOPE property, always return SCOPE_SYSTEM, as the max170xx is used for the main battery on all known systems with a max170xx. 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')
-rw-r--r--drivers/power/supply/max17042_battery.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
index 3e19797fec4b..aecaaa2b0586 100644
--- a/drivers/power/supply/max17042_battery.c
+++ b/drivers/power/supply/max17042_battery.c
@@ -97,6 +97,7 @@ static enum power_supply_property max17042_battery_props[] = {
97 POWER_SUPPLY_PROP_TEMP_MIN, 97 POWER_SUPPLY_PROP_TEMP_MIN,
98 POWER_SUPPLY_PROP_TEMP_MAX, 98 POWER_SUPPLY_PROP_TEMP_MAX,
99 POWER_SUPPLY_PROP_HEALTH, 99 POWER_SUPPLY_PROP_HEALTH,
100 POWER_SUPPLY_PROP_SCOPE,
100 POWER_SUPPLY_PROP_CURRENT_NOW, 101 POWER_SUPPLY_PROP_CURRENT_NOW,
101 POWER_SUPPLY_PROP_CURRENT_AVG, 102 POWER_SUPPLY_PROP_CURRENT_AVG,
102}; 103};
@@ -371,6 +372,9 @@ static int max17042_get_property(struct power_supply *psy,
371 if (ret < 0) 372 if (ret < 0)
372 return ret; 373 return ret;
373 break; 374 break;
375 case POWER_SUPPLY_PROP_SCOPE:
376 val->intval = POWER_SUPPLY_SCOPE_SYSTEM;
377 break;
374 case POWER_SUPPLY_PROP_CURRENT_NOW: 378 case POWER_SUPPLY_PROP_CURRENT_NOW:
375 if (chip->pdata->enable_current_sense) { 379 if (chip->pdata->enable_current_sense) {
376 ret = regmap_read(map, MAX17042_Current, &data); 380 ret = regmap_read(map, MAX17042_Current, &data);