]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
power: supply: max17042_battery: Add support for the SCOPE property
authorHans de Goede <hdegoede@redhat.com>
Fri, 14 Apr 2017 18:32:58 +0000 (20:32 +0200)
committerSebastian Reichel <sre@kernel.org>
Mon, 1 May 2017 10:37:58 +0000 (12:37 +0200)
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>
drivers/power/supply/max17042_battery.c

index 3e19797fec4b98efb7e749dbfdca8f5d1528c13c..aecaaa2b0586027036f467805358697e979b4538 100644 (file)
@@ -97,6 +97,7 @@ static enum power_supply_property max17042_battery_props[] = {
        POWER_SUPPLY_PROP_TEMP_MIN,
        POWER_SUPPLY_PROP_TEMP_MAX,
        POWER_SUPPLY_PROP_HEALTH,
+       POWER_SUPPLY_PROP_SCOPE,
        POWER_SUPPLY_PROP_CURRENT_NOW,
        POWER_SUPPLY_PROP_CURRENT_AVG,
 };
@@ -371,6 +372,9 @@ static int max17042_get_property(struct power_supply *psy,
                if (ret < 0)
                        return ret;
                break;
+       case POWER_SUPPLY_PROP_SCOPE:
+               val->intval = POWER_SUPPLY_SCOPE_SYSTEM;
+               break;
        case POWER_SUPPLY_PROP_CURRENT_NOW:
                if (chip->pdata->enable_current_sense) {
                        ret = regmap_read(map, MAX17042_Current, &data);