Valve Snuck The Lenovo Legion Go S Controller Support Into The Linux Kernel

Valve is supporting Lenovo with the Legion Go S gaming handheld running their Arch Linux based SteamOS. Beyond the fanfare at CES, Valve has been collaborating with Lenovo on engineering resources for ensuring the Legion Go S is running well with SteamOS and in turn the mainline Linux kernel. It turns out from a recent sneaky patch, Valve quietly added support to the Linux kernel for what ended up being the Lenovo Legion Go S controller/input handling.

Last month I wrote about a “QH Controller” being added to the XPad driver for the mainline Linux kernel by Pierre-Loup A. Griffais of Valve who is known for his Linux contributions. I wasn’t able to find much at all about the QH Electronics controller beyond the patch mentions itself… But as I wrote in that earlier article:

“I haven’t been able to dig up much on the QH Electronics Controller itself and the original mailing list patch post didn’t shed any further insight on it, but evidently notable enough for a Valve developer to tackle adding the Linux support for it.”

It turns out it was a notable contribution indeed. That “QH Electronics” addition was really a placeholder / codename / fake product to conceal the support being for the Lenovo Legion Go S controller.

Legion Go S with SteamOS

A patch series this weekend unfolded that mystery with renaming the QH Electronics controller to the Legion Go S:

“The QH controller is actually the controller of the Legion Go S, with the manufacturer string wch.cn and product name Legion Go S in its USB descriptor. A cursory lookup of the VID reveals the same.

Therefore, rename the xpad entries to match.”

The patch cover letter also suggested in the future for these entries where simple vendor/device IDs just need to be added to an input driver and Valve wanting to conceal the actual product, it could be done instead by a udev rule instead to avoid the immediate need for a kernel patch while also working out on older kernel versions:

“@Pierre-Loup: for upcoming devices you do not want to leak the existence of, a little trick for enabling the xpad driver is via udev rule. This is also good for backwards compatibility.”

So with this patch series, the “QH Controller” entry is replaced by the proper Legion Go S identification for the XPad input driver. That patch series also adds controller support for the Zotac Zone and TECNO Pocket Go devices.

QH Legion patch fix

It’s a bit odd the step of concealing the controller support since there were already Legion Go S related Linux patches going back to late last year working on WMI driver handling and the like. It’s also not unprecedented that this codename/placeholder to conceal the Legion Go S support was used – in the past AMD used colorful fishy codenames to conceal early enablement patches for unreleased GPUs. AMD has since moved to their IP-based/block-by-block versioning and enumeration of new hardware. There are also other vendors that use product codenames within their open-source driver patches and the like.

In any case, it’s nice seeing this Lenovo Legion Go S support going into the upstream Linux kernel in a timely manner.