]> Git Repo - J-linux.git/commitdiff
power: supply: cw2015: correct time_to_empty units in sysfs
authorJan Palus <[email protected]>
Sat, 11 Nov 2023 22:17:04 +0000 (23:17 +0100)
committerSebastian Reichel <[email protected]>
Thu, 16 Nov 2023 00:34:12 +0000 (01:34 +0100)
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sebastian Reichel <[email protected]>
drivers/power/supply/cw2015_battery.c

index bb29e9ebd24a8eb2b96f5a1513f02419aa14d043..99f3ccdc30a6a77dc06ba6c7ba54ed47e7358b9c 100644 (file)
@@ -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;
This page took 0.087222 seconds and 4 git commands to generate.