Read the overview document first.
Huawei laptops using the huawei_wmi
driver provide both a start and a stop
charge threshold ranging from 0% (threshold off) to 100%. The hardware behaviour is:
-
When connecting the charger, charging starts if the charge level is below the start threshold
-
Once started, charging stops when the charge level reaches the stop threshold
-
If the charge level is higher than the stop threshold, the battery will not discharge automatically; it will only be discharged when the charger is removed i.e. the laptop runs on battery
When suitable hardware has been detected, tlp-stat -b
shows:
+++ Battery Care
Plugin: huawei
Supported features: charge thresholds
Driver usage:
* natacpi (huawei_wmi) = active (charge thresholds)
Parameter value ranges:
* START_CHARGE_THRESH_BAT0/1: 0(off)..95(default)..100
* STOP_CHARGE_THRESH_BAT0/1: 0(off)..100(default)
+++ Battery Status: BAT0
...
/sys/class/power_supply/BAT0/charge_control_start_threshold = 95 [%]
/sys/class/power_supply/BAT0/charge_control_end_threshold = 100 [%]
...
Battery charging is a process not controlled by TLP itself, but by the laptop's embedded controller (EC). This makes the process work even when switched off or no operating system is running. You cannot change the basic behavior, it is hard-coded into the EC firmware by the vendor. TLP just writes the charge threshold into the EC with the help of the kernel driver, the EC takes care of the rest.
Packages are provided at the download page.
Linux kernel 5.4 or higher required.
Important: please provide all terminal input and output from the test cases via an individual Gist and link it in your post below.
Edit /etc/tlp.conf (or a config file of your choice under /etc/tlp.d/):
START_CHARGE_THRESH_BAT0="70"
STOP_CHARGE_THRESH_BAT0="80"
Note: if necessary replace with your own values that suit the test case.
Connect the charger.
Enter the following commands in a terminal (as root or with sudo
):
tlp start
tlp-stat -s -c -b
Verify that charge_control_start_threshold = 70
and charge_control_end_threshold = 80
.
- Let the laptop run on battery power until the charge level falls below the stop threshold by at least 2%
- Connect the charger and see if charging starts
- Verify that charging stops at 80% (or your configured value)
Enter the command (as root or with sudo
):
tlp-stat -b
Enter the commands (as root or with sudo
):
tlp setcharge 85 90
tlp-stat -b
Verify that charge_control_start_threshold = 85
, charge_control_end_threshold = 90
and charging starts.
Note: if necessary replace with your own values that suit the test case.
Enter the commands (as root or with sudo
):
tlp setcharge
tlp-stat -b
Verify thatcharge_control_start_threshold = 70
, charge_control_end_threshold = 80
and charging halts.
Edit the config file used above and comment the parameters to disable them:
#START_CHARGE_THRESH_BAT0="70"
#STOP_CHARGE_THRESH_BAT0="80"
Enter the commands (as root or with sudo
):
tlp fullcharge
tlp-stat -b
Verify that charge_control_start_threshold = 95
, charge_control_end_threshold = 100
and the battery gets fully charged.
- Are there Huawei laptops with more than one battery (
tlp-stat -b
should show)?
Beta 2 is out. Enjoy!