[gnome-settings-daemon] wacom: check for the new HID unified kernel ABI when setting LEDs
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: check for the new HID unified kernel ABI when setting LEDs
- Date: Tue, 12 Aug 2014 21:58:23 +0000 (UTC)
commit 1c6627f5b51cb30fecda0e57e6d8d77bccb5171c
Author: Benjamin Tissoires <benjamin tissoires redhat com>
Date: Tue Aug 12 10:49:32 2014 -0400
wacom: check for the new HID unified kernel ABI when setting LEDs
In kernel v3.17 and later, the Wacom LED sysfs attribute is located under
the HID node, not the USB one. This new path is now common between USB
and Bluetooth, so no special handling is required for Bluetooth now.
Check for its availability first, and then fall back on the old path.
https://bugzilla.gnome.org/show_bug.cgi?id=734455
plugins/wacom/gsd-wacom-led-helper.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-led-helper.c b/plugins/wacom/gsd-wacom-led-helper.c
index a00dfdf..2f558ee 100644
--- a/plugins/wacom/gsd-wacom-led-helper.c
+++ b/plugins/wacom/gsd-wacom-led-helper.c
@@ -82,6 +82,21 @@ get_led_sys_path (GUdevClient *client,
GList *element;
const char *dev_hid_uniq;
+ /* check for new unified hid implementation first */
+ parent = g_udev_device_get_parent_with_subsystem (device, "hid", NULL);
+ if (parent) {
+ status = g_strdup_printf ("status_led%d_select", group_num);
+ filename = g_build_filename (g_udev_device_get_sysfs_path (parent), "wacom_led", status,
NULL);
+ g_free (status);
+ g_object_unref (parent);
+ if(g_file_test (filename, G_FILE_TEST_EXISTS)) {
+ *write_value = led_num;
+ return filename;
+ }
+ g_clear_pointer (&filename, g_free);
+ }
+
+ /* old kernel */
if (usb) {
parent = g_udev_device_get_parent_with_subsystem (device, "usb", "usb_interface");
if (!parent)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]