From 57bb707d48131f4daad2b1b746eab586eb66b4f3 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 12 Feb 2017 12:33:22 +0100 Subject: rules: Add extended evdev/input match rules for event nodes with the same name Sometimes a system may have 2 input event nodes with the same name where we only want to apply keyboard hwdb rules to 1 of the 2 devices. This problem happens e.g. on devices where the soc_button_array driver is used (e.g. intel atom based tablets) which registers 2 event nodes with the name "gpio-keys". This commit adds a new extended match rule which extends the match to also check $attr{phys} and $attr{capabilities/ev}, allowing to differentiate between devices with an identical name. Suggested-by: Dmitry Torokhov Signed-off-by: Hans de Goede --- rules/60-evdev.rules | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'rules') diff --git a/rules/60-evdev.rules b/rules/60-evdev.rules index ade7e7f646..f5d5ba6a5f 100644 --- a/rules/60-evdev.rules +++ b/rules/60-evdev.rules @@ -12,6 +12,10 @@ ENV{ID_INPUT_KEY}=="?*", DRIVERS=="atkbd", \ IMPORT{builtin}="hwdb 'evdev:atkbd:$attr{[dmi/id]modalias}'", \ RUN{builtin}+="keyboard", GOTO="evdev_end" +# device matching the input device name + properties + the machine's DMI data +KERNELS=="input*", IMPORT{builtin}="hwdb 'evdev:name:$attr{name}:phys:$attr{phys}:ev:$attr{capabilities/ev}:$attr{[dmi/id]modalias}'", \ + RUN{builtin}+="keyboard", GOTO="evdev_end" + # device matching the input device name and the machine's DMI data KERNELS=="input*", IMPORT{builtin}="hwdb 'evdev:name:$attr{name}:$attr{[dmi/id]modalias}'", \ RUN{builtin}+="keyboard", GOTO="evdev_end" -- cgit v1.2.1