summaryrefslogtreecommitdiff
path: root/udev/90-libinput-model-quirks.rules.in
blob: f29cb8a280dc5976057d031118e7422d52bfeb9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Do not edit this file, it will be overwritten on update
#
# This file contains lookup rules for libinput model-specific quirks.
# The contents of this file are a contract between libinput, udev rules and
# the hwdb.
# IT IS NOT A STABLE API AND SUBJECT TO CHANGE AT ANY TIME
#
# The hwdb database is in:
#	90-libinput-model-quirks.hwdb

ACTION!="add|change", GOTO="libinput_model_quirks_end"
KERNEL!="event*", GOTO="libinput_model_quirks_end"

# Firmware detection, two-stage process.
# First, run the program and import the LIBINPUT_MODEL_FIRMWARE_VERSION
# environment (if any)
KERNELS=="*input*", \
  ENV{ID_INPUT_TOUCHPAD}=="1", \
  ENV{.DETECT_FWVERSION}="1"
KERNELS=="*input*", \
  ENV{ID_INPUT_POINTINGSTICK}=="1", \
  ENV{.DETECT_FWVERSION}="1"
ENV{.DETECT_FWVERSION}!="1", GOTO="skip_fwversion"

IMPORT{program}="@UDEV_TEST_PATH@libinput-model-quirks %S%p"
ENV{LIBINPUT_MODEL_FIRMWARE_VERSION}!="", \
  IMPORT{builtin}="hwdb 'libinput:name:$attr{name}:fwversion:$env{LIBINPUT_MODEL_FIRMWARE_VERSION}'"
# End of touchpad firmware detection
LABEL="skip_fwversion"

# libinput:touchpad:<modalias>
ENV{ID_INPUT_TOUCHPAD}=="1", \
  IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:touchpad:"

# libinput:tablet:<modalias>
ENV{ID_INPUT_TABLET}=="1", \
  IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:tablet:"

# libinput:mouse:<modalias>
ENV{ID_INPUT_MOUSE}=="1", \
  IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:mouse:"

# libinput:touchpad:<modalias>
ENV{ID_INPUT_KEYBOARD}=="1", \
  IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:keyboard:"

# libinput:name:<name>:dmi:<dmi string>
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}'"

ENV{ID_INPUT_POINTINGSTICK}=="1", \
  ATTRS{sensitivity}=="?*", \
  ENV{LIBINPUT_ATTR_TRACKPOINT_SENSITIVITY}="$attr{sensitivity}"

LABEL="libinput_model_quirks_end"