Commit f3766911 authored by Jan Palus's avatar Jan Palus Committed by Sebastian Reichel

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: b4c7715c ("power: supply: add CellWise cw2015 fuel gauge driver")
Signed-off-by: default avatarJan Palus <jpalus@fastmail.com>
Link: https://lore.kernel.org/r/20231111221704.5579-1-jpalus@fastmail.comSigned-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent b85ea95d
......@@ -491,7 +491,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment