hwdb: fix udev rule for uhid devices

The MX Master is using BLE to connect, and so the system sees it as a uhid
device. The current rule ignores it because uhid devices do not have the
ID_BUS set.

Fix that by detecting uhid devices and put the bus in the hwdb accordingly.

For completeness, also add usb through uhid so we can also replay devices
and test their drivers.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Benjamin Tissoires
2015-10-09 17:03:25 -04:00
parent ebad4ecd0a
commit f48ee7e25b

View File

@@ -11,6 +11,12 @@ KERNELS=="input*", ENV{ID_BUS}=="usb", \
KERNELS=="input*", ENV{ID_BUS}=="bluetooth", \
IMPORT{builtin}="hwdb 'mouse:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \
GOTO="mouse_end"
KERNELS=="input*", ENV{DEVPATH}=="/devices/virtual/misc/uhid/0003:*", \
IMPORT{builtin}="hwdb 'mouse:usb:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \
GOTO="mouse_end"
KERNELS=="input*", ENV{DEVPATH}=="/devices/virtual/misc/uhid/0005:*", \
IMPORT{builtin}="hwdb 'mouse:bluetooth:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \
GOTO="mouse_end"
DRIVERS=="psmouse", SUBSYSTEMS=="serio", \
IMPORT{builtin}="hwdb 'mouse:ps2::name:$attr{device/name}:'", \
GOTO="mouse_end"