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