summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-10-30 10:12:12 +0100
committerGitHub <noreply@github.com>2017-10-30 10:12:12 +0100
commit64d2753a878ea5b9d1fc5d9ac66ebb37a4930da7 (patch)
tree87f66030a486d57f92ddbe904af5b342fbd34ca9
parent27b8198e132b3763d8a18ddf4ef2ef0713e849f6 (diff)
parent0fbe78ac7a4c5689660b1c1e2c956ffa1a2e4ee5 (diff)
downloadsystemd-64d2753a878ea5b9d1fc5d9ac66ebb37a4930da7.tar.gz
Merge pull request #7212 from whot/master
hwdb: add a hwdb for custom ID_INPUT_* overrides
-rw-r--r--hwdb/60-input-id.hwdb64
-rwxr-xr-xhwdb/parse_hwdb.py13
-rw-r--r--rules/60-input-id.rules1
3 files changed, 78 insertions, 0 deletions
diff --git a/hwdb/60-input-id.hwdb b/hwdb/60-input-id.hwdb
new file mode 100644
index 0000000000..b05b402d74
--- /dev/null
+++ b/hwdb/60-input-id.hwdb
@@ -0,0 +1,64 @@
+# This file is part of systemd.
+#
+# The lookup keys are composed in:
+# 60-input-id.rules
+#
+# Note: The format of the "input-id:" prefix match key is a
+# contract between the rules file and the hardware data, it might
+# change in later revisions to support more or better matches, it
+# is not necessarily expected to be a stable ABI.
+#
+# Match string formats:
+# id-input:modalias:<modalias>
+#
+# To add local entries, create a new file
+# /etc/udev/hwdb.d/61-input-id-local.hwdb
+# and add your rules there. To load the new rules execute (as root):
+# systemd-hwdb update
+# udevadm trigger /dev/input/eventXX
+# where /dev/input/eventXX is the device in question. If in
+# doubt, simply use /dev/input/event* to reload all input rules.
+#
+# If your changes are generally applicable, preferably send them as a pull
+# request to
+# https://github.com/systemd/systemd
+# or create a bug report on https://github.com/systemd/systemd/issues and
+# include your new rules, a description of the device, and the output of
+# udevadm info /dev/input/eventXX.
+#
+# This file must only be used where the input_id builtin assigns the wrong
+# properties or lacks the assignment of some properties. This is almost
+# always caused by a device not adhering to the standard of the device's
+# type.
+#
+# Allowed properties are:
+# ID_INPUT
+# ID_INPUT_ACCELEROMETER, ID_INPUT_MOUSE,
+# ID_INPUT_POINTINGSTICK, ID_INPUT_TOUCHSCREEN, ID_INPUT_TOUCHPAD,
+# ID_INPUT_TABLET, ID_INPUT_TABLET_PAD, ID_INPUT_JOYSTICK, ID_INPUT_KEY,
+# ID_INPUT_KEYBOARD, ID_INPUT_SWITCH, ID_INPUT_TRACKBALL
+#
+# ID_INPUT
+# * MUST be set when ANY of ID_INPUT_* is set
+# * MUST be unset when ALL of ID_INPUT_* are unset
+#
+# ID_INPUT_TABLET
+# * MUST be set when setting ID_INPUT_TABLET_PAD
+#
+# Allowed values are 1 and 0 to set or unset, repsectively.
+#
+# NOT allowed in this file are:
+# ID_INPUT_WIDTH_MM, ID_INPUT_HEIGHT_MM, ID_INPUT_TOUCHPAD_INTEGRATION
+#
+
+# Example:
+# id-input:modalias:input:b0003v1234pABCD*
+# ID_INPUT_TOUCHPAD=1
+# ID_INPUT=1
+
+# Sort by brand, model
+
+# UC-Logic TABLET 1060N Pad
+id-input:modalias:input:b0003v5543p0081*
+ ID_INPUT_TABLET=1
+ ID_INPUT_TABLET_PAD=1
diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py
index a25ac8d904..eb52dc917b 100755
--- a/hwdb/parse_hwdb.py
+++ b/hwdb/parse_hwdb.py
@@ -65,6 +65,7 @@ UDEV_TAG = Word(string.ascii_uppercase, alphanums + '_')
TYPES = {'mouse': ('usb', 'bluetooth', 'ps2', '*'),
'evdev': ('name', 'atkbd', 'input'),
+ 'id-input': ('modalias'),
'touchpad': ('i8042', 'rmi', 'bluetooth', 'usb'),
'joystick': ('i8042', 'rmi', 'bluetooth', 'usb'),
'keyboard': ('name', ),
@@ -105,6 +106,18 @@ def property_grammar():
('MOUSE_WHEEL_CLICK_ANGLE_HORIZONTAL', INTEGER),
('MOUSE_WHEEL_CLICK_COUNT', INTEGER),
('MOUSE_WHEEL_CLICK_COUNT_HORIZONTAL', INTEGER),
+ ('ID_INPUT', Literal('1')),
+ ('ID_INPUT_ACCELEROMETER', Literal('1')),
+ ('ID_INPUT_JOYSTICK', Literal('1')),
+ ('ID_INPUT_KEY', Literal('1')),
+ ('ID_INPUT_KEYBOARD', Literal('1')),
+ ('ID_INPUT_MOUSE', Literal('1')),
+ ('ID_INPUT_POINTINGSTICK', Literal('1')),
+ ('ID_INPUT_SWITCH', Literal('1')),
+ ('ID_INPUT_TABLET', Literal('1')),
+ ('ID_INPUT_TABLET_PAD', Literal('1')),
+ ('ID_INPUT_TOUCHPAD', Literal('1')),
+ ('ID_INPUT_TOUCHSCREEN', Literal('1')),
('ID_INPUT_TRACKBALL', Literal('1')),
('MOUSE_WHEEL_TILT_HORIZONTAL', Literal('1')),
('MOUSE_WHEEL_TILT_VERTICAL', Literal('1')),
diff --git a/rules/60-input-id.rules b/rules/60-input-id.rules
index dee42199b6..bb8a812d1b 100644
--- a/rules/60-input-id.rules
+++ b/rules/60-input-id.rules
@@ -3,5 +3,6 @@
ACTION=="remove", GOTO="id_input_end"
SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id"
+SUBSYSTEM=="input", IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=id-input:modalias:"
LABEL="id_input_end"