Don't tag i2c mice as pointing sticks (#39264)

There are no real i2c mice but there are i2c `FooBar Mouse` devices that
are an artifact of how the HID kernel drivers split up event nodes.
These nodes will be seen for some i2c keyboards and touchpads, depending
on the HID report descriptor.

Let's not tag those as pointing sticks.

Closes #36677
This commit is contained in:
Yu Watanabe
2025-10-20 15:04:27 +09:00
committed by GitHub
3 changed files with 24 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
#
# Match string formats:
# id-input:modalias:<modalias>
# id-input:<bus>:v<vid>p<pid>:name:<name>:*
#
# To add local entries, create a new file
# /etc/udev/hwdb.d/61-input-id-local.hwdb
@@ -47,9 +48,20 @@
# id-input:modalias:input:b0003v1234pABCD*
# ID_INPUT_TOUCHPAD=1
# ID_INPUT=1
#
# id-input:usb:v12abp34cd:name:SomeVendor *:*
# ID_INPUT_TOUCHPAD=1
# ID_INPUT=1
#
# For technical reasons the hexadecimal vid/pid in the modalias match are
# uppercase but lowercase in the bus/vid/pid/name match.
# Sort by brand, model
# Any i2c device with a Mouse suffix in the name is not a pointing stick
id-input:i2c:*:name:*Mouse:
ID_INPUT_POINTINGSTICK=0
# Code Mercenaries Hard- und Software GmbH Virtual RC USB
id-input:modalias:input:b0003v07C0p1125*
ID_INPUT_MOUSE=

View File

@@ -75,7 +75,7 @@ UDEV_TAG = Word(string.ascii_uppercase, alphanums + '_')
TYPES = {'mouse': ('usb', 'bluetooth', 'ps2', '*'),
'evdev': ('name', 'atkbd', 'input'),
'fb': ('pci', 'vmbus'),
'id-input': ('modalias'),
'id-input': ('modalias', 'bluetooth', 'i2c', 'usb'),
'touchpad': ('i8042', 'rmi', 'bluetooth', 'usb'),
'joystick': ('i8042', 'rmi', 'bluetooth', 'usb'),
'keyboard': ('name', ),

View File

@@ -5,4 +5,15 @@ 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:"
# id-input:<bus>:v<vid>p<pid>:name:<name>:*
KERNELS=="input*", ATTRS{id/bustype}=="0003", \
IMPORT{builtin}="hwdb 'id-input:usb:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \
GOTO="id_input_end"
KERNELS=="input*", ATTRS{id/bustype}=="0005", \
IMPORT{builtin}="hwdb 'id-input:bluetooth:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \
GOTO="id_input_end"
KERNELS=="input*", ATTRS{id/bustype}=="0018", \
IMPORT{builtin}="hwdb 'id-input:i2c:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \
GOTO="id_input_end"
LABEL="id_input_end"