upower: Support Multiple Keyboard Backlight LED Control
Upower can only set one keyboard backlight LED brightness. It finds the first keyboard backlight LED sysfs entry and then set up the DBus API entry for it. This works on most of the laptops but can’t work on some gaming laptops which have more than one keyboard backlight LED needs to take care. Moreover, if a USB keyboard with backlight LED was attached to laptop, upower has to discover it and set up or remove the API entry dynamically. The previous MR [1] proposed an implementation to setup multiple brightness but it can’t add/remove the device information automatically.
The new proposed MR [2] was based on udev event which gave as the device status when user install or remove a keyboard backlight LED device. Through this way, the DBus API entry and device information can be added/removed with the the udev events like what we do for the batteries. In the mean time, a abstraction class for keyboard backlight LED was proposed so upower can support different implementation, such as Linux, FreeBSD, and more [3].
[1] https://gitlab.freedesktop.org/upower/upower/-/merge_requests/203
[2] https://gitlab.freedesktop.org/upower/upower/-/merge_requests/258
[3] https://gitlab.freedesktop.org/upower/upower/-/issues/291