diff options
| author | Jan Palus <jpalus@fastmail.com> | 2023-11-11 23:17:04 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-25 14:37:53 -0800 |
| commit | 89b97e6b19a8f488a8369781b096fc85ce8228f3 (patch) | |
| tree | 06277de5a67d7715152d56075bf47140dc9c7704 /drivers | |
| parent | 5e3995ec39c4149b3927755cc6dea83dac0c104b (diff) | |
| download | linux-89b97e6b19a8f488a8369781b096fc85ce8228f3.tar.gz linux-89b97e6b19a8f488a8369781b096fc85ce8228f3.tar.bz2 linux-89b97e6b19a8f488a8369781b096fc85ce8228f3.zip | |
power: supply: cw2015: correct time_to_empty units in sysfs
[ Upstream commit f37669119423ca852ca855b24732f25c0737aa57 ]
RRT_ALRT register holds remaining battery time in minutes therefore it
needs to be scaled accordingly when exposing TIME_TO_EMPTY via sysfs
expressed in seconds
Fixes: b4c7715c10c1 ("power: supply: add CellWise cw2015 fuel gauge driver")
Signed-off-by: Jan Palus <jpalus@fastmail.com>
Link: https://lore.kernel.org/r/20231111221704.5579-1-jpalus@fastmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/power/supply/cw2015_battery.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/cw2015_battery.c b/drivers/power/supply/cw2015_battery.c index de1fa71be1e8..d1071dbb904e 100644 --- a/drivers/power/supply/cw2015_battery.c +++ b/drivers/power/supply/cw2015_battery.c @@ -490,7 +490,7 @@ static int cw_battery_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW: if (cw_battery_valid_time_to_empty(cw_bat)) - val->intval = cw_bat->time_to_empty; + val->intval = cw_bat->time_to_empty * 60; else val->intval = 0; break; |
