1

I am trying to preserve long-term battery life by capping my laptop's charging behavior so that the battery doesn't go beyond 80% (or maybe 60) charged. I've been reading several posts and threads, but have not found an ideal solution for my setup yet. I think I've found one here (/sys/class/power_supply/BAT0/charge_...), but want to get some expert advice before I start changing file contents around in this directory.

What do the following files do?

  • charge_control_end_threshold
  • charge_control_start_threshold
  • charge_start_threshold
  • charge_stop_threshold

I have used the cat command to see their contents on my laptop, and they are as follows:

:~$ cat /sys/class/power_supply/BAT0/charge_control_end_threshold 
100
:~$ cat /sys/class/power_supply/BAT0/charge_control_start_threshold 
0
:~$ cat /sys/class/power_supply/BAT0/charge_start_threshold 
0
:~$ cat /sys/class/power_supply/BAT0/charge_stop_threshold 
100
:~$ 

If I change the first or last file contents from 100 to 80 (or 60), will the battery stop charging at 80%? What else would happen--anything bad, weird, or unexpected?

(if it's useful I'm using: OS: Ubuntu 24.04 LTS. Model: Lenovo ThinkPad X13 Gen 4. Processor: AMD Ryzen™ 7 PRO 7840U. Kernal: Linux 6.8.0-31-generic)

dcpetit
  • 47

1 Answers1

2

From the default configuration file tlp.conf from TLP:

# Battery charge level below which charging will begin.
#START_CHARGE_THRESH_BAT0=75
# Battery charge level above which charging will stop.
#STOP_CHARGE_THRESH_BAT0=80

The comments tell you what they do. If I modify the value of STOP_CHARGE_THRESH_BAT0, TLP writes the value into /sys/class/power_supply/BAT0/charge_control_end_threshold, so you can infer that charge_control_end_threshold determines the battery charge level above which charging will stop, and charge_control_start_threshold determines the battery charge level below which charging will begin.

According to What is difference between 'charge_start_threshold' and 'charge_control_start_threshold', charge_start_threshold and charge_end_threshold seem to be legacy.

palapapa
  • 136
  • 1
  • 3