More HID BPF Functionality & New Drivers For Linux 6.11

Written by Michael Larabel in Hardware on 7 July 2024 at 08:35 AM EDT. 3 Comments
HARDWARE
Upstreamed to the mainline Linux kernel last year was HID BPF as a means of more easily shipping new drivers and in particular quirks/workarounds for different HID devices. This allows for some nice continued innovations around (e)BPF within the Linux kernel. With Linux 6.11 there is yet more HID BPF capabilities to be upstreamed as well as new drivers.

Within hid.git's for-next branch is a lot of new HID BPF code queued ahead of Linux 6.11. There are new HID BPF helpers and hooks, documentation improvements, and other changes to that core HID BPF code in making the (e)BPF route more capable for HID driver use-cases.

What it means for new HID BPF driver usage in Linux 6.11 is a Huion Inspiroy 2S (H641P) driver:
"This is a a driver for the Huion Inspiroy 2S in both modes (firmware mode and tablet mode). This device has 6 buttons and a wheel, all of which send key combinations (see the comments for the defaults). Luckily the device is quite limited in that it only supports one button down at a time, so with this BPF we can simply remap the 8 possible report IDs to our own custom-built report descriptor.

If the device is in tablet mode (e.g. using huion-switcher it sends everything through the vendor report instead). This BPF program converts both, depending which devices you attach to you get both. Or if you attach to all hid devices you get a duplicate device but it'll work either way.

This BPF should be mostly compatible for the M and L as well though they have more buttons so the rdescs will need some minor rework."

There's also a new BPF program for supporting the XP-PEN Deco Mini 4.

A BPF program for the Huion Dial 2.

Thrustmaster Boeing joystick


Lastly of the HID BPF code at the moment is a BPF program for the Thrustmaster TCA Yoke Boeing joystick.

Great seeing all the work on HID BPF beginning to pan out for the Linux kernel.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week