-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Framework, Chromebook] Battery care support based on the cros_charge-control driver (as of Linux 6.11) #765
Comments
* Supports Framework Laptop 13/16 Intel/AMD * Requires cros_charge-control module (Linux 6.10+) * Start and stop threshold * Force discharge not supported (planned) * charge_control_start_threshold: - Valid values: 0..100 - limited to 0..99 - Default value: 0 * charge_control_end_threshold: - Valid values: 0..100 - limnited to 1..100 - Default value: 100 Credits: * Thomas Weißschuh * Patrick McLean Reference: * https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/drivers/power/supply/cros_charge-control.c?h=review-hans&id=c6ed48ef52599098498a8442fd60bea5bd8cd309 * https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/tree/drivers/power/supply/cros_charge-control.c?h=review-hans * #765
With this fixed:
|
Thanks, I now check if /sys/class/dmi/id/sys_vendor is "Framework".
Improved. Please test again.
Oh, no! Do not run this: It only works as a simulation on a ThinkPad (for my dev qa) not on real Framework hardware ... The fact that the mAh/mA sysfiles read plausible values is new to me:
I only know of implausible values that are presumably to be interpreted as mWh/mW, see here.
A well-known coreboot disease. Doesn't seem to be the case with your model then, I have removed the coreboot workaround. Please show
again. |
Only the Framework Chromebook uses coreboot. |
@t-8ch LGTM :-). Thank you for testing. |
@t-8ch I have finished the second stage of the plugin with discharge/recalibrate. Please test it with
You can force an earlier end to the discharging process by specifying a certain charge level (in mAh) with the debug parameter
I would also like to ask for your feedback on the safety message:
|
* Framework driver converted into a generic one * Supports laptops with ChromeOS EC: - Framework Laptop 13/16 Intel/AMD - Chromebooks modded with chrultrabook/coreboot custom UEFI firmware * Requires cros_charge-control module (Linux 6.10+) * Start and stop threshold * Recalibrate/discharge (locked by default) * charge_control_start_threshold: - Valid values: 0..100 - limited to 0..99 - Default value: 0 * charge_control_end_threshold: - Valid values: 0..100 - limnited to 1..100 - Default value: 100 Credits: * Thomas Weißschuh * Patrick McLean * iks230 References: * https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c6ed48ef52599098498a8442fd60bea5bd8cd309 * https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/power/supply/cros_charge-control.c * #765 * https://docs.chrultrabook.com/docs/firmware/ * https://thinkpad-forum.de/threads/c13-yoga-gen-1-chromebook-%E2%80%93-tipps-erfahrungen.240712/#post-2404669
@t-8ch After I found a tester by chance, I converted the plugin from a framework-specific to a generic one for all laptops with ChromeOS EC. See 1st post. The automatic test script moves to unit-tests/charge-thresholds_chromeos-ec-BAT1 |
Doesn't seem to be working on my Framework 16, even though the
|
@MithicSpirit please show the output of
|
|
The out-of-tree module framework_laptop is loaded and has moved in front of cros_charge-control. Unfortunately, atm I don't know how to prevent this. Try to unload framework_laptop and cros_charge-control, then load cros_charge-control only. |
Doesn't seem to fix it. I'll try disabling the framework_laptop module later when I have time. |
Rationale: in case that framework_laptop preempts the module cros_charge-control, the cros-ec plugin cannot initialize and we continue with the framework plugin. Reference: * #765 (comment)
@MithicSpirit I have now restored the original plugin for the framework_laptop module which support only a stop threshold. You need to install /usr/share/tlp/bat.d/55-chromeos-ec and /usr/share/tlp/bat.d/56-framework. Then show
|
Seems to be working now.
|
@MithicSpirit lhe framework plugin is intended as a fallback in case you need framework_laptop for reasons other than battery care. I would be happy if you could still blacklist framework_laptop and then test the extended functionality of the chromeos-ec plugin based on the cros_charge-control module. |
Based on the preliminary work from @chutz, here is a rewrite of the plugin requiring the new driver cros_charge-control released with [EDIT] Linux 6.11.
EDIT: the plugin has been converted from a framework-specific to a generic one for all laptops with ChromeOS EC. It supports the following hardware:
For the test you either need TLP 1.7.0, supplemented by the download of /usr/share/tlp/bat.d/55-chromeos-ec, or you can build a package for your distribution based on Branch feature/bat.d/framework.
I need at least the output of
If the plugin is properly activated, the output contains this:
Only if the plugin is properly activated
Depending on whether the battery name is BAT0 or BAT1 (check
tlp-stat -b
output), start the corresponding automatic test script (with sudo or as root) and show the output:It requires the tool clitest to be installed. Should be available as a package in most distributions.
References:
@t-8ch @Simerax @chutz
The text was updated successfully, but these errors were encountered: