]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
power: supply: max17042_battery: Fix current_{avg,now} hiding with no current sense
authorSebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Wed, 25 Nov 2020 04:44:44 +0000 (05:44 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 4 Jan 2021 15:37:06 +0000 (16:37 +0100)
BugLink: https://bugs.launchpad.net/bugs/1910111
[ Upstream commit 4b0a56e692503692da6555337a697c17feabbb3e ]

When current sense is disabled, max17042_no_current_sense_psy_desc gets
used which ignores two last properties from the list.

Fixes: 21b01cc879cc ("power: supply: max17042_battery: Add support for the TTE_NOW prop")
Reported-by: Timon Baetz <timon.baetz@protonmail.com>
Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/power/supply/max17042_battery.c

index f284547913d6fdb8ef8763034da1f0296cf1f1b4..2e9672fe4df1f284491f4f5d228566154b3a5167 100644 (file)
@@ -85,9 +85,10 @@ static enum power_supply_property max17042_battery_props[] = {
        POWER_SUPPLY_PROP_TEMP_MAX,
        POWER_SUPPLY_PROP_HEALTH,
        POWER_SUPPLY_PROP_SCOPE,
+       POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
+       // these two have to be at the end on the list
        POWER_SUPPLY_PROP_CURRENT_NOW,
        POWER_SUPPLY_PROP_CURRENT_AVG,
-       POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
 };
 
 static int max17042_get_temperature(struct max17042_chip *chip, int *temp)