From 7957f2ba49c7a6136643c63563d293bdb93a0309 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Mon, 1 Jun 2020 18:51:51 -0700 Subject: [PATCH] Add a workaround for PowerA Wireless Controller Add a workaround for PowerA Wireless Controller, which doesn't report valid VID/PID via Bluetooth making it hard to properly tag it with "uaccess" via UDEV. The approach taken by this commit is to trigger on input device, instead of the usual hidraw, and then rely on "udevadm test-builtin" to apply "uacess" permission at runtime. The reason to trigger on input device is because it is the first device in device hierarchy that gets access to reported "name" which is unique to this particular type of a controller and can be reliably matched against. --- 60-steam-input.rules | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/60-steam-input.rules b/60-steam-input.rules index 1cbf258..342f02b 100644 --- a/60-steam-input.rules +++ b/60-steam-input.rules @@ -34,6 +34,13 @@ KERNEL=="hidraw*", KERNELS=="*057E:2009*", MODE="0660", TAG+="uaccess" # PowerA Wired Controller for Nintendo Switch KERNEL=="hidraw*", ATTRS{idVendor}=="20d6", ATTRS{idProduct}=="a711", MODE="0660", TAG+="uaccess" +# PowerA Wireless Controller for Nintendo Switch we have to use +# ATTRS{name} since VID/PID are reported as zeros. We use /bin/sh +# instead of udevadm directly becuase we need to use '*' glob at the +# end of "hidraw" name since we don't know the index it'd have. +# +KERNEL=="input*", ATTRS{name}=="Lic Pro Controller", RUN{program}+="/bin/sh -c \"udevadm test-builtin uaccess /sys/%p/../../hidraw/hidraw*\"" + # Nacon PS4 Revolution Pro Controller KERNEL=="hidraw*", ATTRS{idVendor}=="146b", ATTRS{idProduct}=="0d01", MODE="0660", TAG+="uaccess"