Open-source developer Derek J. Clark continues leading the efforts on improving the Lenovo Legion Go series hardware support under Linux. Posted today was the second iteration of the HID driver work for the Legion Go and Legion Go S for configuration support with the built-in controller HID interfaces.
There has been a lot of Lenovo Legion Go Linux activity over the past year for ensuring that these gaming handhelds work well for the likes of Valve’s Steam OS. Most recently Clark has been working on the HID driver support for adjusting the sleep timeout, rumble intensity, and other attributes under Linux.
Derek explained with today’s v2 patch series:
“This series adds configuration driver support for the Legion Go S, Legion Go, and Legion Go 2 built-in controller HID interfaces. This allows for configuring hardware specific attributes such as the auso sleep timeout, rumble intensity, etc. non-configuration reports are forwarded to the HID subsystem to ensure no loss of functionality in userspace. Basic gamepad functionality is provided through xpad, while advanced features are currently only implemented in userspace daemons such as InputPlumber. I plan to move this functionality into the kernel in a later patch series.
Three new device.h macros are added that solve a fairly specific problem. Many of the attributes need to have the same name as other attributes when they are in separate attribute subdirectories. The previous version of this series, along with the upcoming hid-asus-ally driver use this macro to simplify the sysfs by removing redundancy. An upcoming out of tree driver for the Zotac Zone also found this macro to be useful. This greatly reduces the path length and term redundancy of file paths in the sysfs, while also allowing for cleaner subdirectories that are grouped by functionality. Rather than carry the same macro in four drivers, it seems beneficial to me that we include the macro with the other device macros.
A new HID uevent property is also added, HID_FIRMWARE_VERSION, so as to permit fwupd to read the firmware version of the Go S HID interface without detaching the kernel driver.”
Compared to the original patches, the v2 patches break-up the Lenovo Legion Go S code into its own driver. This Lenovo Legion HID driver work is now under review while we see if this work will manage to be ready for upstreaming in time for the Linux 7.0 cycle.
