From bd1acc9f2ffa9c2baf1ddd6bb965352aef5c7446 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 3 Apr 2015 12:07:32 +0200 Subject: udev: input_id: tag accelerometers as ID_INPUT_ACCELEROMETER input_id already (tries to) tag accelerometers as such, but this only works for absolute accelerometers. Recent kernels mark accelerometers through an input prop. Trust that prop and always tag devices with it with ID_INPUT_ACCELEROMETER. Note that detection by the prop bit works the same as the existing detection and will ensure that no other tags get set on the device. --- src/udev/udev-builtin-input_id.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/udev/udev-builtin-input_id.c') diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c index d4c38cae6e..ecfc447527 100644 --- a/src/udev/udev-builtin-input_id.c +++ b/src/udev/udev-builtin-input_id.c @@ -136,6 +136,11 @@ static void test_pointers (struct udev_device *dev, int is_mouse = 0; int is_touchpad = 0; + if (test_bit (INPUT_PROP_ACCELEROMETER, bitmask_props)) { + udev_builtin_add_property(dev, test, "ID_INPUT_ACCELEROMETER", "1"); + return; + } + if (!test_bit (EV_KEY, bitmask_ev)) { if (test_bit (EV_ABS, bitmask_ev) && test_bit (ABS_X, bitmask_abs) && -- cgit v1.2.3-54-g00ecf