Patch "power: supply: cw2015: correct time_to_empty units in sysfs" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    power: supply: cw2015: correct time_to_empty units in sysfs

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     power-supply-cw2015-correct-time_to_empty-units-in-s.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d6dd1517bd66ef42a72de6dec92cb2cd151f6b90
Author: Jan Palus <jpalus@xxxxxxxxxxxx>
Date:   Sat Nov 11 23:17:04 2023 +0100

    power: supply: cw2015: correct time_to_empty units in sysfs
    
    [ Upstream commit f37669119423ca852ca855b24732f25c0737aa57 ]
    
    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@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20231111221704.5579-1-jpalus@xxxxxxxxxxxx
    Signed-off-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/power/supply/cw2015_battery.c b/drivers/power/supply/cw2015_battery.c
index de1fa71be1e8..d1071dbb904e 100644
--- a/drivers/power/supply/cw2015_battery.c
+++ b/drivers/power/supply/cw2015_battery.c
@@ -490,7 +490,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;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux