Commit 4b0a56e6 authored by Sebastian Krzyszkowiak's avatar Sebastian Krzyszkowiak Committed by Sebastian Reichel
Browse files

power: supply: max17042_battery: Fix current_{avg,now} hiding with no current sense



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

Fixes: 21b01cc8 ("power: supply: max17042_battery: Add support for the TTE_NOW prop")
Reported-by: default avatarTimon Baetz <timon.baetz@protonmail.com>
Signed-off-by: default avatarSebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent d4e9e7b6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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)