Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 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>

authored by

Jan Palus and committed by
Sebastian Reichel
f3766911 b85ea95d

+1 -1
+1 -1
drivers/power/supply/cw2015_battery.c
··· 491 491 492 492 case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW: 493 493 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; 495 495 else 496 496 val->intval = 0; 497 497 break;