summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorJan Palus <jpalus@fastmail.com>2023-11-11 23:17:04 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2023-11-16 01:34:12 +0100
commitf37669119423ca852ca855b24732f25c0737aa57 (patch)
treea017e7647707fec7ff52b3e2c54b70765b56c018 /drivers/power
parentb85ea95d086471afb4ad062012a4d73cd328fa86 (diff)
downloadlwn-f37669119423ca852ca855b24732f25c0737aa57.tar.gz
lwn-f37669119423ca852ca855b24732f25c0737aa57.zip
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>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/cw2015_battery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/cw2015_battery.c b/drivers/power/supply/cw2015_battery.c
index bb29e9ebd24a..99f3ccdc30a6 100644
--- a/drivers/power/supply/cw2015_battery.c
+++ b/drivers/power/supply/cw2015_battery.c
@@ -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;