summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2022-04-05 14:20:35 +0200
committerBastien Nocera <hadess@hadess.net>2022-04-05 14:22:21 +0200
commit7d476c4563ddc07939c3852b256c8869603b8c4b (patch)
treecd8c2df4f85e8420c534538d158f077f6940a4b9
parent197be5324e9c0cb27afd7cba8fa6803f6bd25c61 (diff)
downloadsystemd-wip/hadess/logitech-hidraw.tar.gz
Add Logitech receivers and devices to hwdb and add uaccesswip/hadess/logitech-hidraw
This adds support for Logitech USB receivers and Bluetooth devices to be accessed by users at the console, so that they can use an application like Solaar out-of-the-box.
-rw-r--r--hwdb.d/70-input-devices.hwdb27
-rw-r--r--hwdb.d/meson.build1
-rwxr-xr-xhwdb.d/parse_hwdb.py1
-rw-r--r--src/login/70-uaccess.rules.in3
4 files changed, 32 insertions, 0 deletions
diff --git a/hwdb.d/70-input-devices.hwdb b/hwdb.d/70-input-devices.hwdb
new file mode 100644
index 0000000000..7db24316d4
--- /dev/null
+++ b/hwdb.d/70-input-devices.hwdb
@@ -0,0 +1,27 @@
+# This file is part of systemd.
+#
+# Database for input devices that need hidraw access for all the features to work.
+#
+# This currently only covers Logitech receivers (Bolt, Unifying, etc.) and Bluetooth
+# Logitech devices.
+#
+# To add local entries, copy this file to
+# /etc/udev/hwdb.d/
+# and add your rules there. To load the new rules execute (as root):
+# systemd-hwdb update
+# udevadm trigger
+
+################
+# Logitech
+################
+# USB-connected Logitech receivers and devices
+usb:v046d*
+ ID_INPUT_DEVICE_NEEDS_RAW=1
+
+# Lenovo Nano Receiver
+usb:v17efp6042*
+ ID_INPUT_RECEIVER_NEEDS_RAW=1
+
+# Bluetooth-connected Logitech devices
+bluetooth:v046d*
+ ID_INPUT_RECEIVER_NEEDS_RAW=1
diff --git a/hwdb.d/meson.build b/hwdb.d/meson.build
index b4c519c8fd..a7c7373e81 100644
--- a/hwdb.d/meson.build
+++ b/hwdb.d/meson.build
@@ -29,6 +29,7 @@ hwdb_files_test = files(
'70-analyzers.hwdb',
'70-av-production.hwdb',
'70-cameras.hwdb',
+ '70-input-devices.hwdb',
'70-joystick.hwdb',
'70-mouse.hwdb',
'70-pda.hwdb',
diff --git a/hwdb.d/parse_hwdb.py b/hwdb.d/parse_hwdb.py
index 93179b675c..0975070952 100755
--- a/hwdb.d/parse_hwdb.py
+++ b/hwdb.d/parse_hwdb.py
@@ -140,6 +140,7 @@ def property_grammar():
('ID_PDA', Or((Literal('0'), Literal('1')))),
('ID_INPUT', Or((Literal('0'), Literal('1')))),
('ID_INPUT_ACCELEROMETER', Or((Literal('0'), Literal('1')))),
+ ('ID_INPUT_DEVICE_NEEDS_RAW', Or((Literal('0'), Literal('1')))),
('ID_INPUT_JOYSTICK', Or((Literal('0'), Literal('1')))),
('ID_INPUT_KEY', Or((Literal('0'), Literal('1')))),
('ID_INPUT_KEYBOARD', Or((Literal('0'), Literal('1')))),
diff --git a/src/login/70-uaccess.rules.in b/src/login/70-uaccess.rules.in
index a3301be1bc..90acc3892d 100644
--- a/src/login/70-uaccess.rules.in
+++ b/src/login/70-uaccess.rules.in
@@ -91,6 +91,9 @@ KERNEL=="rfkill", SUBSYSTEM=="misc", TAG+="uaccess"
# Most of these devices use HID for the knobs, faders, buttons, encoders, and jog wheels.
SUBSYSTEM=="hidraw", ENV{ID_AV_PRODUCTION_CONTROLLER}=="1", TAG+="uaccess"
+# Input devices that require HID access for full feature support
+SUBSYSTEM=="hidraw", ENV{ID_INPUT_DEVICE_NEEDS_RAW}=="1", TAG+="uaccess"
+
# Some devices use vendor defined protocols on USB Bulk endpoints for controllers.
# Other devices transfer graphics to screens on the device through USB Bulk endpoints.
# This also allows accessing HID devices with the libusb backend of hidapi.