Skip to content

Add ThinkPad support for battery charge thresholds#474

Merged
leviport merged 2 commits intopop-os:masterfrom
spxak1:patch-1
Feb 25, 2026
Merged

Add ThinkPad support for battery charge thresholds#474
leviport merged 2 commits intopop-os:masterfrom
spxak1:patch-1

Conversation

@spxak1
Copy link
Copy Markdown
Contributor

@spxak1 spxak1 commented Feb 22, 2026

System76-power checks for the standard charge_control_start_threshold and charge_control_end_threshold files in /sys.

ThinkPads use the thinkpad_acpi kernel module to expose these exact files and support threshold limits.

Currently system76-power cannot control/set limits on ThinkPads. Hopefully this pull request (following through the previous one for Huawei laptops) should do it.

This will prevent (new) ThinkPad owners from replacing system76-power with tlp.

@jackpot51 jackpot51 requested review from a team February 22, 2026 13:49
Copy link
Copy Markdown
Member

@jacobgkau jacobgkau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spxak1 Have you checked that this works on your ThinkPad, and can you let us know what model it is?

We previously had someone attempt to bypass this check for their ThinkPad, but they stated it didn't work and that they thought additional code was required: #470

It's probably fine to do this if it works on at least some ThinkPads, but I wanted to check that it works at all since you didn't mention testing it.

@spxak1
Copy link
Copy Markdown
Contributor Author

spxak1 commented Feb 25, 2026

@spxak1 Have you checked that this works on your ThinkPad, and can you let us know what model it is?

We previously had someone attempt to bypass this check for their ThinkPad, but they stated it didn't work and that they thought additional code was required: #470

It's probably fine to do this if it works on at least some ThinkPads, but I wanted to check that it works at all since you didn't mention testing it.

I have a few Thinkpads here. An X13 Yoga Gen2, a T14s Gen4 (AMD) and an L390 is also somewhere.

All three use the same files for thresholds. Afaik all X/T/P/L series use these. E-Series are Ideapads, so I think they use the ideapad_acpi driver which possibly uses a different file, not sure, but I can check with a Thinkbook I got here, which definitely uses the ideapad_acpi driver. I have no idea what the Z series uses. I'll get back with robust results.

@jacobgkau
Copy link
Copy Markdown
Member

I'd fully expect the charge control files to be present on your systems. I'm more wanting to verify that you've actually compiled this branch locally, installed it, and you see the thresholds take effect. You should be able to do this by running sudo apt build-dep system76-power followed by dpkg-buildpackage -b -uc -us from the system76-power directory, and then installing the resulting .deb file(s) in the parent directory.

We do this kind of testing ourselves for System76 hardware, but I don't have ThinkPads available to test with, so that (combined with the prior contributor stating they saw their battery not actually respect the charge thresholds after setting them with these files) is why I wanted to confirm with you.

@leviport
Copy link
Copy Markdown
Member

I have an X1 Carbon I can test with. I installed this and can set charge thresholds with system76-power. It's charging now, so I'll see if it stops as expected.

Copy link
Copy Markdown
Member

@leviport leviport left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that looks like it's doing what it's supposed to do. It was around 50% when I got it out of my bag. The default system76-power charge-thresholds were reported to be 0 and 100. I set them to 60 and 70 and let it sit, while watching watch upower -d. Once it hit 70%, I saw the status change from charging to pending charge. Then I turned the limits up to 80 & 90 and it started charging again.

Thanks for the change!

@leviport leviport merged commit feb0f78 into pop-os:master Feb 25, 2026
29 checks passed
szydell added a commit to szydell/system76-power that referenced this pull request Apr 25, 2026
* upstream/master:
  Add ThinkPad support for battery charge thresholds (pop-os#474)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants