upower/rules/60-upower-battery.rules
Kate Hsuan 83f86c75d2 rules: 60-upower-battery: Fix for Asus battery charge threshold detection
At boot, the Asus battery driver returns -ENODATA [1] to avoid resetting
charge threshold settings. This behavior prevents UPower's udev rules
from detecting the charge threshold feature. This issue can be resolved
by testing for the attribute's existence when matching udev rules, rather
than performing a read operation at boot.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers?id=186bf90

Resolves: #347
Signed-off-by: Kate Hsuan <hpa@redhat.com>
2026-07-02 15:03:33 +08:00

11 lines
414 B
Text

ACTION=="remove", GOTO="battery_end"
SUBSYSTEM=="power_supply", TEST=="charge_control_start_threshold", \
IMPORT{builtin}="hwdb 'battery:$kernel:$attr{model_name}:$attr{[dmi/id]modalias}'", \
GOTO="battery_end"
SUBSYSTEM=="power_supply", TEST=="charge_control_end_threshold", \
IMPORT{builtin}="hwdb 'battery:$kernel:$attr{model_name}:$attr{[dmi/id]modalias}'", \
GOTO="battery_end"
LABEL="battery_end"