Add ThinkPad support for battery charge thresholds#474
Add ThinkPad support for battery charge thresholds#474leviport merged 2 commits intopop-os:masterfrom
Conversation
Added ||
jacobgkau
left a comment
There was a problem hiding this comment.
@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. |
|
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 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. |
|
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. |
leviport
left a comment
There was a problem hiding this comment.
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!
* upstream/master: Add ThinkPad support for battery charge thresholds (pop-os#474)
System76-power checks for the standard
charge_control_start_thresholdandcharge_control_end_thresholdfiles in/sys.ThinkPads use the
thinkpad_acpikernel module to expose these exact files and support threshold limits.Currently
system76-powercannot 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-powerwithtlp.