aboutsummaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2009-11-30 18:38:43 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2009-11-30 18:38:43 +0100
commita6cf7734015dfc4479f4fdd4585d8953979fe0b0 (patch)
treecfea8e3acc45d4434c599db11abdebc0fd8c3358 /rules
parentd6b5571c1237c0a8e49dfc148615309f9c1a6c5c (diff)
downloadudev-a6cf7734015dfc4479f4fdd4585d8953979fe0b0.tar.gz
extras: Add input_id
input_id probes input/event devices for their class (keyboard, keys, mouse, touchpad, tablet, joystick). This is based on the corresponding hal code in hald/linux/device.c, input_test_{abs,rel,...}. This should provide enough functionality to get hal-less X.org working (which in particular needs to know exactly which devices are touchpads). Replace the brittle hacks in 60-persistent-input.rules with checking for the new ID_INPUT_* flags. This keeps the old ID_CLASS properties for now (but they are to be removed later on). Note: The current code has several hacks still, which are to be replaced with proper libudev calls later on.
Diffstat (limited to 'rules')
-rw-r--r--rules/rules.d/60-persistent-input.rules18
1 files changed, 7 insertions, 11 deletions
diff --git a/rules/rules.d/60-persistent-input.rules b/rules/rules.d/60-persistent-input.rules
index c65517b8..08fe49bb 100644
--- a/rules/rules.d/60-persistent-input.rules
+++ b/rules/rules.d/60-persistent-input.rules
@@ -4,22 +4,18 @@ ACTION!="add|change", GOTO="persistent_input_end"
SUBSYSTEM!="input", GOTO="persistent_input_end"
KERNEL=="input[0-9]*", GOTO="persistent_input_end"
-SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p"
+ENV{ID_INPUT}=="", IMPORT{program}="input_id %p"
+SUBSYSTEMS=="usb", ENV{ID_BUS}=="", IMPORT{program}="usb_id --export %p"
-# well defined boot-subclass usb devices
-SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="01", ENV{ID_CLASS}="kbd", GOTO="serial"
-SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="02", ENV{ID_CLASS}="mouse", GOTO="serial"
+# backwards-compatibility ID_CLASS
+ENV{ID_INPUT_KEYBOARD}=="?*", ENV{ID_CLASS}="kbd"
+ENV{ID_INPUT_MOUSE}=="?*", ENV{ID_CLASS}="mouse"
+ENV{ID_INPUT_JOYSTICK}=="?*", ENV{ID_CLASS}="joystick"
-# other devices
+# other device types which we need for persistent links
DRIVERS=="pcspkr", ENV{ID_CLASS}="spkr", GOTO="serial"
-DRIVERS=="atkbd", ENV{ID_CLASS}="kbd", GOTO="serial"
-DRIVERS=="psmouse", ENV{ID_CLASS}="mouse", GOTO="serial"
ATTRS{name}=="*dvb*|*DVB*|* IR *", ENV{ID_CLASS}="ir", GOTO="serial"
-# joystick (ABS_X || ABS_WHEEL || ABS_THROTTLE) && !BTN_TOUCH && !BTN_DIGI
-ATTRS{modalias}=="input:*-*a[068],*|input:*-*a*,[68],*m*", ATTRS{modalias}!="input:*-*k*14[0A],*r*", \
- ENV{ID_CLASS}="joystick", GOTO="serial"
-
# fill empty serial number
LABEL="serial", ENV{ID_CLASS}=="?*", ENV{ID_SERIAL}=="", ENV{ID_SERIAL}="noserial"