chiark / gitweb /
path_id: implement in C using libudev
[elogind.git] / rules / rules.d / 60-persistent-input.rules
1 # do not edit this file, it will be overwritten on update
2
3 ACTION!="add|change", GOTO="persistent_input_end"
4 SUBSYSTEM!="input", GOTO="persistent_input_end"
5 KERNEL=="input[0-9]*", GOTO="persistent_input_end"
6
7 SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p"
8
9 # well defined boot-subclass usb devices
10 SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="01", ENV{ID_CLASS}="kbd", GOTO="serial"
11 SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="02", ENV{ID_CLASS}="mouse", GOTO="serial"
12
13 # other devices
14 DRIVERS=="pcspkr", ENV{ID_CLASS}="spkr", GOTO="serial"
15 DRIVERS=="atkbd", ENV{ID_CLASS}="kbd", GOTO="serial"
16 DRIVERS=="psmouse", ENV{ID_CLASS}="mouse", GOTO="serial"
17 ATTRS{name}=="*dvb*|*DVB*|* IR *", ENV{ID_CLASS}="ir", GOTO="serial"
18
19 # joystick (ABS_X || ABS_WHEEL || ABS_THROTTLE) && !BTN_TOUCH
20 ATTRS{modalias}=="input:*-*a[068],*|input:*-*a*,[68],*m*", ATTRS{modalias}!="input:*-*k*14A,*r*", \
21   ENV{ID_CLASS}="joystick", GOTO="serial"
22
23 # fill empty serial number
24 LABEL="serial", ENV{ID_CLASS}=="?*", ENV{ID_SERIAL}=="", ENV{ID_SERIAL}="noserial"
25
26 # by-id links
27 KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{ID_CLASS}=="?*", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_CLASS}"
28 KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{ID_CLASS}=="?*", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-$env{ID_CLASS}"
29 # allow empty class for USB devices, by appending the interface number
30 SUBSYSTEMS=="usb", ENV{ID_BUS}=="?*", KERNEL=="event*", ENV{ID_CLASS}=="", ATTRS{bInterfaceNumber}=="?*", \
31   SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-if$attr{bInterfaceNumber}"
32
33 # by-path
34 SUBSYSTEMS=="usb|platform", IMPORT{program}="path_id %p"
35 ENV{ID_PATH}=="?*", KERNEL=="mouse*|js*", ENV{ID_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{ID_CLASS}"
36 ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{ID_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-event-$env{ID_CLASS}"
37 # allow empty class for platform and usb devices; platform supports only a single interface that way
38 SUBSYSTEMS=="usb|platform", ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{ID_CLASS}=="", \
39   SYMLINK+="input/by-path/$env{ID_PATH}-event"
40
41 LABEL="persistent_input_end"