Read the overview document first.
LG Gram laptops using the lg_laptop
driver have a feature called
'battery care limit', basically a fixed stop charge threshold at 80%.
The hardware behaviour is:
-
Connected to the charger, 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: lg
Supported features: charge threshold
Driver usage:
* vendor (lg_laptop) = active (charge threshold)
Parameter value range:
* STOP_CHARGE_THRESH_BAT0: 80(on), 100(off) -- battery care limit
/sys/devices/platform/lg-laptop/battery_care_limit = 80 [%]
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 4.20 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/):
STOP_CHARGE_THRESH_BAT0="80"
Connect the charger.
Enter the following commands in a terminal (as root or with sudo
):
tlp start
tlp-stat -s -c -b
Verify that battery_care_limit = 80
.
- Let the laptop run on battery power until the charge level falls below at least 70%
- Connect the charger and see if charging starts
- Verify that charging stops at 80%
Enter the command (as root or with sudo
):
tlp-stat -b
Edit the config file used above:
STOP_CHARGE_THRESH_BAT0="100"
Enter the commands (as root or with sudo
):
tlp fullcharge
tlp-stat -b
Verify that battery_care_limit = 100
and the battery gets fully charged.
- Are there LG Gram laptops with more than one battery (
tlp-stat -b
should show)?
Folks, regardless of what I do I can't get battery_care_limit=80
Here's what tlp-stat -s -c -b gives me:
ricardo@LG:~$ sudo tlp-stat -s -c -b
--- TLP 1.4.0-beta.1 --------------------------------------------
+++ Configured Settings:
/etc/tlp.conf L0029: TLP_ENABLE="1"
defaults.conf L0005: TLP_WARN_LEVEL="3"
defaults.conf L0006: TLP_PERSISTENT_DEFAULT="0"
defaults.conf L0007: DISK_IDLE_SECS_ON_AC="0"
defaults.conf L0008: DISK_IDLE_SECS_ON_BAT="2"
defaults.conf L0009: MAX_LOST_WORK_SECS_ON_AC="15"
defaults.conf L0010: MAX_LOST_WORK_SECS_ON_BAT="60"
defaults.conf L0011: CPU_ENERGY_PERF_POLICY_ON_AC="balance_performance"
defaults.conf L0012: CPU_ENERGY_PERF_POLICY_ON_BAT="balance_power"
defaults.conf L0013: SCHED_POWERSAVE_ON_AC="0"
defaults.conf L0014: SCHED_POWERSAVE_ON_BAT="1"
defaults.conf L0015: NMI_WATCHDOG="0"
defaults.conf L0016: DISK_DEVICES="nvme0n1 sda"
defaults.conf L0017: DISK_APM_LEVEL_ON_AC="254 254"
defaults.conf L0018: DISK_APM_LEVEL_ON_BAT="128 128"
defaults.conf L0019: DISK_APM_CLASS_DENYLIST="usb ieee1394"
defaults.conf L0020: DISK_IOSCHED="keep keep"
defaults.conf L0021: SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
defaults.conf L0022: SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power"
defaults.conf L0023: AHCI_RUNTIME_PM_ON_AC="on"
defaults.conf L0024: AHCI_RUNTIME_PM_ON_BAT="auto"
defaults.conf L0025: AHCI_RUNTIME_PM_TIMEOUT="15"
defaults.conf L0026: PCIE_ASPM_ON_AC="default"
defaults.conf L0027: PCIE_ASPM_ON_BAT="default"
defaults.conf L0028: RADEON_POWER_PROFILE_ON_AC="default"
defaults.conf L0029: RADEON_POWER_PROFILE_ON_BAT="default"
defaults.conf L0030: RADEON_DPM_PERF_LEVEL_ON_AC="auto"
defaults.conf L0031: RADEON_DPM_PERF_LEVEL_ON_BAT="auto"
defaults.conf L0032: WIFI_PWR_ON_AC="off"
defaults.conf L0033: WIFI_PWR_ON_BAT="on"
defaults.conf L0034: WOL_DISABLE="Y"
defaults.conf L0035: SOUND_POWER_SAVE_ON_AC="1"
defaults.conf L0036: SOUND_POWER_SAVE_ON_BAT="1"
defaults.conf L0037: SOUND_POWER_SAVE_CONTROLLER="Y"
defaults.conf L0038: BAY_POWEROFF_ON_AC="0"
defaults.conf L0039: BAY_POWEROFF_ON_BAT="0"
defaults.conf L0040: BAY_DEVICE="sr0"
defaults.conf L0041: RUNTIME_PM_ON_AC="on"
defaults.conf L0042: RUNTIME_PM_ON_BAT="auto"
defaults.conf L0043: RUNTIME_PM_DRIVER_DENYLIST="mei_me nouveau radeon"
defaults.conf L0044: USB_AUTOSUSPEND="1"
defaults.conf L0045: USB_EXCLUDE_AUDIO="1"
defaults.conf L0046: USB_EXCLUDE_BTUSB="0"
defaults.conf L0047: USB_EXCLUDE_PHONE="0"
defaults.conf L0048: USB_EXCLUDE_PRINTER="1"
defaults.conf L0049: USB_EXCLUDE_WWAN="0"
defaults.conf L0050: USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN="0"
defaults.conf L0051: RESTORE_DEVICE_STATE_ON_STARTUP="0"
defaults.conf L0052: RESTORE_THRESHOLDS_ON_BAT="0"
defaults.conf L0053: NATACPI_ENABLE="1"
defaults.conf L0054: TPACPI_ENABLE="1"
defaults.conf L0055: TPSMAPI_ENABLE="1"
/etc/tlp.conf L0500: STOP_CHARGE_THRESH_BAT0="80"
+++ System Info
System = LG Electronics 0.1 17Z990-R.AAS7U1
BIOS = W1ZD1250 X64
OS Release = Ubuntu 18.04.5 LTS
Kernel = 5.4.0-80-generic #90~18.04.1-Ubuntu SMP Tue Jul 13 19:40:02 UTC 2021 x86_64
/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-5.4.0-80-generic root=UUID=dc0a74e6-8f43-412b-bf1c-43a26ab5c36b ro quiet splash vt.handoff=1
Init system = systemd v237
Boot mode = UEFI
+++ TLP Status
State = enabled
RDW state = enabled
Last run = 10:59:35, 85 sec(s) ago
Mode = battery
Power source = battery
+++ Battery Care
Plugin: lg
Supported features: charge threshold
Driver usage:
Parameter value range:
/sys/devices/platform/lg-laptop/battery_care_limit = 0 [%]
What am I doing wrong? Please notice that I'm using Ubuntu Mate (Linux LG 5.4.0-80-generic #90~18.04.1-Ubuntu SMP Tue Jul 13 19:40:02 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux).