From 84aab7aefaf252f459d8278be9f2290381c6faa5 Mon Sep 17 00:00:00 2001 From: "Sicelo A. Mhlongo" Date: Tue, 12 Aug 2025 13:32:46 +0200 Subject: [PATCH] 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. --- src/linux/up-enumerator-udev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/linux/up-enumerator-udev.c b/src/linux/up-enumerator-udev.c index 20a8e7d..e1b0456 100644 --- a/src/linux/up-enumerator-udev.c +++ b/src/linux/up-enumerator-udev.c @@ -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; }