udev: Add support for device-tree-based model selection
authorPaul Kocialkowski <contact@paulk.fr>
Fri, 28 Apr 2017 13:32:59 +0000 (15:32 +0200)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 6 Jun 2017 23:32:24 +0000 (09:32 +1000)
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).

Note that this requires systemd updates, see
https://github.com/systemd/systemd/pull/5837

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
udev/90-libinput-model-quirks.hwdb
udev/90-libinput-model-quirks.rules.in

index 229fb1defe3a69a01294359e6bae4a4fc7eb01f5..75b374d6b18156a82dcc49877fe4616c2103b64b 100644 (file)
@@ -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
index ace2bf077264cea1a24dc5e53f89fe55f4a939c5..08137812884e919b587d67a9d16b0227d9120080 100644 (file)
@@ -41,4 +41,8 @@ ENV{ID_INPUT_KEYBOARD}=="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"