[PATCH libinput 1/3] udev: Add support for device-tree-based model selection

Paul Kocialkowski contact at paulk.fr
Fri Apr 28 13:32:59 UTC 2017


This adds support for detecting input peripherals based on their name
and the device-tree model of the device they're used with.

This is mostly an equivalent to dmi-based model detection (e.g. on x86
devices) for device that use device-tree (e.g. on ARM devices).

Signed-off-by: Paul Kocialkowski <contact at paulk.fr>
---
 udev/90-libinput-model-quirks.hwdb     | 1 +
 udev/90-libinput-model-quirks.rules.in | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 378c31a..a111368 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -12,6 +12,7 @@
 #	libinput:mouse:<modalias>
 #	libinput:touchpad:<modalias>
 #	libinput:name:<name>:dmi:<dmi string>
+#	libinput:name:<name>:dt:<device-tree string>
 #	libinput:name:<name>:fwversion:<version>
 #
 # Sort by brand, model
diff --git a/udev/90-libinput-model-quirks.rules.in b/udev/90-libinput-model-quirks.rules.in
index 8bff192..1cc0c49 100644
--- a/udev/90-libinput-model-quirks.rules.in
+++ b/udev/90-libinput-model-quirks.rules.in
@@ -37,4 +37,8 @@ ENV{ID_INPUT_MOUSE}=="1", \
 KERNELS=="input*", \
   IMPORT{builtin}="hwdb 'libinput:name:$attr{name}:$attr{[dmi/id]modalias}'"
 
+# libinput:name:<name>:dt:<device-tree string>
+KERNELS=="input*", \
+  IMPORT{builtin}="hwdb 'libinput:name:$attr{name}:dt:$attr{[devicetree/base]model}'"
+
 LABEL="libinput_model_quirks_end"
-- 
2.12.2



More information about the wayland-devel mailing list