[PATCH v3 3/4] udev: add a custom udev rule for X230 touchpads

Benjamin Tissoires benjamin.tissoires at gmail.com
Thu Apr 16 11:41:35 PDT 2015


X230 touchpads should be tagged as LIBINPUT_MODEL_LENOVO_X230 by udev to
apply a different acceleration profile.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires at gmail.com>
---
Changes to v1:
- more generic rule (in the file name and the way it is handled)

No changes to v2.

 udev/99-libinput-model-quirks.rules |   14 ++++++++++++++
 udev/Makefile.am                    |    4 +++-
 2 files changed, 17 insertions(+), 1 deletions(-)
 create mode 100644 udev/99-libinput-model-quirks.rules

diff --git a/udev/99-libinput-model-quirks.rules b/udev/99-libinput-model-quirks.rules
new file mode 100644
index 0000000..1ff4a05
--- /dev/null
+++ b/udev/99-libinput-model-quirks.rules
@@ -0,0 +1,14 @@
+ACTION!="add|change", GOTO="libinput_model_quirks_end"
+KERNEL!="event*", GOTO="libinput_model_quirks_end"
+
+# model specific quirks
+
+# Lenovo X230 have a special touchpad with a low resolution
+
+ATTR{[dmi/id]product_version}=="ThinkPad X230*", \
+  ENV{ID_INPUT_TOUCHPAD}!="", \
+  ENV{ID_PATH}=="platform-i8042-serio-*", \
+  ENV{LIBINPUT_MODEL_LENOVO_X230}="1", \
+  GOTO="libinput_model_quirks_end"
+
+LABEL="libinput_model_quirks_end"
diff --git a/udev/Makefile.am b/udev/Makefile.am
index 3691172..24abdea 100644
--- a/udev/Makefile.am
+++ b/udev/Makefile.am
@@ -6,4 +6,6 @@ libinput_device_group_CFLAGS = $(LIBUDEV_CFLAGS) $(GCC_CFLAGS)
 libinput_device_group_LDADD = $(LIBUDEV_LIBS)
 
 udev_rulesdir=$(UDEV_DIR)/rules.d
-dist_udev_rules_DATA = 80-libinput-device-groups.rules
+dist_udev_rules_DATA = \
+	80-libinput-device-groups.rules \
+	99-libinput-model-quirks.rules
-- 
1.7.1



More information about the wayland-devel mailing list