anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0651-udev-add-ID_INPUT_SWITCH-for-devices-with-switch-cap.patch

a9339c
From fa22d8e9697a0a896007998fdf2cabe7baf98bec Mon Sep 17 00:00:00 2001
a9339c
From: Peter Hutterer <peter.hutterer@who-t.net>
a9339c
Date: Tue, 10 Jan 2017 17:36:46 +1000
a9339c
Subject: [PATCH] udev: add ID_INPUT_SWITCH for devices with switch capability
a9339c
 (#5057)
a9339c
a9339c
(cherry picked from commit 64083a6078630372623bb1013a45d3bf31d8a836)
a9339c
a9339c
Resolves: #1597240
a9339c
---
a9339c
 src/udev/udev-builtin-input_id.c | 3 +++
a9339c
 1 file changed, 3 insertions(+)
a9339c
a9339c
diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c
a9339c
index 46f1c539d..d6ae07304 100644
a9339c
--- a/src/udev/udev-builtin-input_id.c
a9339c
+++ b/src/udev/udev-builtin-input_id.c
a9339c
@@ -250,6 +250,9 @@ static int builtin_input_id(struct udev_device *dev, int argc, char *argv[], boo
a9339c
                 get_cap_mask(dev, pdev, "capabilities/key", bitmask_key, sizeof(bitmask_key), test);
a9339c
                 test_pointers(dev, bitmask_ev, bitmask_abs, bitmask_key, bitmask_rel, test);
a9339c
                 test_key(dev, bitmask_ev, bitmask_key, test);
a9339c
+
a9339c
+                if (test_bit(EV_SW, bitmask_ev))
a9339c
+                        udev_builtin_add_property(dev, test, "ID_INPUT_SWITCH", "1");
a9339c
         }
a9339c
 
a9339c
         devnode = udev_device_get_devnode(dev);