linux: up-enumerator-udev: also permit lp5523:kb name

While common keyboard backlight devices use 'kbd_backlight' in the name, per
linux kernel include/dt-bindings/leds/common.h, there are a few legacy names,
including 'lp5523:kbN'. They cannot be easily changed now because it would
break userspace, hence the names are still provided in the kernel.  Support
them in upower as well. The lp5523 as used on the Nokia N900 exposes six
independent keyboard backlight LEDs, and UPower is able to manage them with
this patch in place.
This commit is contained in:
Sicelo A. Mhlongo 2025-08-12 13:32:46 +02:00 committed by Kate Hsuan
parent afb346cf77
commit 84aab7aefa

View file

@ -320,8 +320,13 @@ uevent_signal_handler_cb (UpEnumeratorUdev *self,
if (g_strcmp0 (g_udev_device_get_subsystem (device), "power_supply") == 0)
device_key = g_udev_device_get_name (device);
/* Consider both 'kbd_backlight' and 'lp5523:kb' as keyboard backlight
* devices. See include/dt-bindings/leds/common.h. 'lp5523:kb' is still
* in use, despite being marked as obsolete/legacy.
*/
if (g_strcmp0 (g_udev_device_get_subsystem (device), "leds") == 0) {
if (g_strrstr (device_key, "kbd_backlight") == NULL)
if (g_strrstr (device_key, "kbd_backlight") == NULL &&
g_strrstr (device_key, "lp5523:kb") == NULL)
return;
is_kbd_backlight = TRUE;
}