mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2025-12-20 04:20:04 +01:00
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:
parent
afb346cf77
commit
84aab7aefa
1 changed files with 6 additions and 1 deletions
|
|
@ -320,8 +320,13 @@ uevent_signal_handler_cb (UpEnumeratorUdev *self,
|
||||||
if (g_strcmp0 (g_udev_device_get_subsystem (device), "power_supply") == 0)
|
if (g_strcmp0 (g_udev_device_get_subsystem (device), "power_supply") == 0)
|
||||||
device_key = g_udev_device_get_name (device);
|
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_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;
|
return;
|
||||||
is_kbd_backlight = TRUE;
|
is_kbd_backlight = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue