fix(backlight): also match the leds subsystem for keyboard backlights

The backlight module only enumerated and monitored the udev "backlight"
subsystem, so keyboard-backlight LEDs in the "leds" class (e.g.
white:kbd_backlight, platform::kbd_backlight) were never discovered and
the module fell back to the default when pointed at one.

Enumerate and monitor the "leds" subsystem in addition to "backlight".
Those LEDs expose the same brightness/max_brightness attributes, so the
read path is unchanged. Each device now records its subsystem so the
login1 SetBrightness call targets the correct one. Automatic device
selection still prefers a "backlight" device and only falls back to a
"leds" device when named explicitly or when no screen backlight exists.

Fixes #2848.
This commit is contained in:
Alex
2026-07-04 13:43:01 +02:00
parent 4c55819888
commit 8ff8ceeca2
4 changed files with 50 additions and 14 deletions
+2 -1
View File
@@ -29,7 +29,8 @@ The brightness can be controlled by dragging the slider across the bar or clicki
*device*: ++
typeof: string ++
The name of the preferred device to control. If left empty, a device will be chosen automatically.
The name of the preferred device to control. If left empty, a device will be chosen automatically. ++
Both screen backlights (the udev *backlight* subsystem) and keyboard backlights (LEDs in the udev *leds* subsystem, e.g. *white:kbd_backlight*) are supported; name such an LED here to control it. When left empty, a screen backlight is always preferred for automatic selection.
*interval*: ++
typeof: uint ++
+2 -1
View File
@@ -17,7 +17,8 @@ The *backlight* module displays the current backlight level.
*device*: ++
typeof: string ++
The name of the preferred backlight device to display. If left empty, a device will be chosen automatically.
The name of the preferred backlight device to display. If left empty, a device will be chosen automatically. ++
Both screen backlights (the udev *backlight* subsystem) and keyboard backlights (LEDs in the udev *leds* subsystem, e.g. *white:kbd_backlight*) are supported; name such an LED here to control it. When left empty, a screen backlight is always preferred for automatic selection.
*format*: ++
typeof: string ++