Skip to content

Commit f376691

Browse files
jpalussre
authored andcommitted
power: supply: cw2015: correct time_to_empty units in sysfs
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: b4c7715 ("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>
1 parent b85ea95 commit f376691

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/power/supply/cw2015_battery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ static int cw_battery_get_property(struct power_supply *psy,
491491

492492
case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW:
493493
if (cw_battery_valid_time_to_empty(cw_bat))
494-
val->intval = cw_bat->time_to_empty;
494+
val->intval = cw_bat->time_to_empty * 60;
495495
else
496496
val->intval = 0;
497497
break;

0 commit comments

Comments
 (0)