Bug 234403 - [acpi_ibm] Support ThinkPad battery charge start/stop control
Summary: [acpi_ibm] Support ThinkPad battery charge start/stop control
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-acpi mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2018-12-25 18:19 UTC by Kevin Zheng
Modified: 2019-07-03 22:28 UTC (History)
2 users (show)

See Also:


Attachments
Use consistent driver name (2.07 KB, patch)
2018-12-25 18:19 UTC, Kevin Zheng
no flags Details | Diff
Support ThinkPad battery charge start/stop control (5.78 KB, patch)
2018-12-25 18:19 UTC, Kevin Zheng
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Zheng 2018-12-25 18:19:11 UTC
Created attachment 200506 [details]
Use consistent driver name

Support ThinkPad battery charge start/stop control using new sysctls:

dev.acpi_ibm.0.bat0_charge_start
dev.acpi_ibm.0.bat0_charge_stop

Informed by the Linux driver: https://lore.kernel.org/patchwork/patch/858076/

And this driver: https://github.com/teleshoes/tpacpi-bat/blob/master/battery_asl

Two patches are attached:
- First one uses a consistent driver name in the source code and man pages "ThinkPad ACPI Extras" instead of references to IBM
- Second one contains the majority of the change
Comment 1 Kevin Zheng 2018-12-25 18:19:45 UTC
Created attachment 200507 [details]
Support ThinkPad battery charge start/stop control
Comment 2 Kevin Zheng 2019-07-03 17:54:30 UTC
Is anybody able to take a look?
Comment 3 rkoberman 2019-07-03 21:03:38 UTC
(In reply to Kevin Zheng from comment #2)

Submitting this on Christmas probably didn't help to get it noticed. Even though I have long wanted the ability to control charging, I totally missed it. A little explanation of why stopping and starting charging is desirable would probably be a desirable, as well.

Not sure about the naming convention change as I believe that this module is appropriate to more Lenovo models than just the Thinkpad. Maybe it is time to just bite the bullet and go to "Lenovo". Not that many IBM units around any more.

That said, any change might cause confusion for current users when acpi_ibm no longer loads.Is that worse than for newer users who no longer think of IBM and Thinkpad as related.
Comment 4 Kevin Zheng 2019-07-03 22:28:32 UTC
(In reply to rkoberman from comment #3)
Perhaps "Lenovo" is better than "ThinkPad" and "IBM". Note that this patch does not change the name of the module, so it is still "acpi_ibm" and loading "acpi_ibm" will still continue to work.

Controlling battery charge thresholds could be useful for prolonging battery life in machines that are used mostly on AC power. On Windows, battery charging thresholds can be controlled using the Lenovo Power Manager. This patch exposes the same functionality through the sysctl interface.