summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2015-04-20 14:29:44 -0400
committerPeter Hutterer <peter.hutterer@who-t.net>2015-04-24 08:38:58 +1000
commit0515a670afa36ec6e6abe98f68abe1af6eebba81 (patch)
tree2da05a656410a35f4f4246a00ad9a3edb12dd20c /udev
parentb81afb019a78d7a0056eb9afeebf32a5062918dc (diff)
evdev: add support for LIBINPUT_MODEL_* udev tags
Some devices need specific configuration or different defaults. Push that into udev rules and a hwdb file, that's where detection is the easiest. The LIBINPUT_MODEL_ prefix is used to determine some type of device model. Note that this property is a private API and subject to change at any time without notice. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Diffstat (limited to 'udev')
-rw-r--r--udev/90-libinput-model-quirks.hwdb16
-rw-r--r--udev/90-libinput-model-quirks.rules25
-rw-r--r--udev/Makefile.am8
3 files changed, 48 insertions, 1 deletions
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
new file mode 100644
index 0000000..02bb8f9
--- /dev/null
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -0,0 +1,16 @@
+# Do not edit this file, it will be overwritten on update
+#
+# This file contains hwdb matches for libinput model-specific quirks.
+# The contents of this file are a contract between libinput, udev rules and
+# the hwdb.
+# IT IS NOT A STABLE API AND SUBJECT TO CHANGE AT ANY TIME
+
+# The lookup keys are composed in:
+# 90-libinput-model-quirks.rules
+#
+# Match string formats:
+# libinput:<modalias>
+# libinput:name:<name>:dmi:<dmi string>
+
+#
+# Sort by brand, model
diff --git a/udev/90-libinput-model-quirks.rules b/udev/90-libinput-model-quirks.rules
new file mode 100644
index 0000000..4b98874
--- /dev/null
+++ b/udev/90-libinput-model-quirks.rules
@@ -0,0 +1,25 @@
+# Do not edit this file, it will be overwritten on update
+#
+# This file contains lookup rules for libinput model-specific quirks.
+# The contents of this file are a contract between libinput, udev rules and
+# the hwdb.
+# IT IS NOT A STABLE API AND SUBJECT TO CHANGE AT ANY TIME
+#
+# The hwdb database is in:
+# 90-libinput-model-quirks.hwdb
+
+ACTION!="add|change", GOTO="libinput_model_quirks_end"
+KERNEL!="event*", GOTO="libinput_model_quirks_end"
+
+# hwdb matches:
+#
+# libinput:<modalias>
+IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:", \
+ GOTO="libinput_model_quirks_end"
+
+# libinput:name:<name>:dmi:<dmi string>
+KERNELS=="input*", \
+ IMPORT{builtin}="hwdb 'libinput:name:$attr{name}:$attr{[dmi/id]modalias}'", \
+ GOTO="libinput_model_quirks_end"
+
+LABEL="libinput_model_quirks_end"
diff --git a/udev/Makefile.am b/udev/Makefile.am
index 3691172..7d19809 100644
--- a/udev/Makefile.am
+++ b/udev/Makefile.am
@@ -6,4 +6,10 @@ 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 \
+ 90-libinput-model-quirks.rules
+
+udev_hwdbdir=$(UDEV_DIR)/hwdb.d
+dist_udev_hwdb_DATA = \
+ 90-libinput-model-quirks.hwdb