pop-os / system76-acpi-dkms

System76 ACPI Driver (DKMS)
GNU General Public License v2.0
16 stars 11 forks source link

Add battery charging thresholds #4

Closed crawfxrd closed 4 years ago

crawfxrd commented 4 years ago

Expose charge_control_{start,end}_threshold for BAT0, allowing users to control battery charging.

Ref: sysfs-class-power Requires: system76/ec#96 Requires: system76/coreboot#15


[oryp5 ~]$ ls -1 /sys/class/power_supply/BAT0/charge_control_*_threshold
/sys/class/power_supply/BAT0/charge_control_end_threshold
/sys/class/power_supply/BAT0/charge_control_start_threshold
jacobgkau commented 4 years ago

If I'm already charging and I change the start threshold to be lower than the current level, charging does not stop-- the new start threshold does not take effect until the end threshold has been reached, even if I unplug to start discharging and then re-plug. Is this behavior expected?

crawfxrd commented 4 years ago

Only modifying the end threshold can disable charging. If you are in a charge cycle, the start value doesn't matter.

jacobgkau commented 4 years ago

This was working for me on the bonw14 yesterday afternoon, but after the latest commits, I'm getting an input/output error trying to set either threshold on both the bonw14 and gaze15. Assuming it's still WIP.

crawfxrd commented 4 years ago

The ACPI interface was changed. You have to flash new firmware to use the latest change.

And I fixed the call to SBCT, so it no longer errors.