Thread (1 message) 1 message, 1 author, 2025-09-02
STALE344d

[PATCH AUTOSEL 6.16-6.6] HID: quirks: add support for Legion Go dual dinput modes

From: Sasha Levin <sashal@kernel.org>
Date: 2025-09-02 12:08:54
Also in: linux-patches, stable
Subsystem: hid core layer, the rest · Maintainers: Jiri Kosina, Benjamin Tissoires, Linus Torvalds

From: Antheas Kapenekakis <lkml@antheas.dev>

[ Upstream commit 1f3214aae9f49faf495f3836216afbc6c5400b2e ]

The Legion Go features detachable controllers which support a dual
dinput mode. In this mode, the controllers appear under a single HID
device with two applications.

Currently, both controllers appear under the same event device, causing
their controls to be mixed up. This patch separates the two so that
they can be used independently.

In addition, the latest firmware update for the Legion Go swaps the IDs
to the ones used by the Legion Go 2, so add those IDs as well.

[jkosina@suse.com: improved shortlog]
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Signed-off-by: Jiri Kosina <redacted>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

Based on my analysis, here's my determination:

**Backport Status: YES**

This commit should be backported to stable kernel trees for the
following reasons:

1. **Fixes a real user-facing bug**: The commit message clearly states
   "Currently, both controllers appear under the same event device,
   causing their controls to be mixed up." This is a functional bug
   where the Legion Go's detachable controllers cannot be used
   independently as intended - their inputs are incorrectly merged
   together.

2. **Hardware quirk fix**: This falls under the stable tree rules
   category of fixing "a hardware quirk." The Legion Go requires special
   handling for its dual dinput mode where two controllers appear as two
   applications under a single HID device.

3. **Small and contained change**: The patch only adds 4 lines total:
   - 2 new device ID definitions in `drivers/hid/hid-ids.h`
   - 2 corresponding quirk entries in `drivers/hid/hid-quirks.c`

4. **Low risk**: The change uses an existing, well-established quirk
   mechanism (`HID_QUIRK_MULTI_INPUT`) that's already used for dozens of
   similar gaming controllers (as seen in hid-quirks.c). This quirk
   simply ensures that when multiple HID reports come from different
   report IDs, they create separate input devices rather than merging
   into one.

5. **Device enablement**: The commit also adds support for new device
   IDs (0x61ed) used by newer firmware and Legion Go 2, which falls
   under the stable rule of "just add a device ID."

6. **User impact**: Without this fix, users cannot properly use the
   Legion Go's detachable controllers independently, which is a core
   feature of the device. The controllers' inputs being mixed together
   makes many games and applications unusable.

The `HID_QUIRK_MULTI_INPUT` flag modifies the behavior in
`drivers/hid/hid-input.c:2305-2320` to ensure that different HID reports
with different IDs create separate hidinput structures, resulting in
separate `/dev/input/eventX` devices for each controller rather than a
single merged device.

 drivers/hid/hid-ids.h    | 2 ++
 drivers/hid/hid-quirks.c | 2 ++
 2 files changed, 4 insertions(+)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 33cc5820f2be1..a687fbbb77b00 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -831,6 +831,8 @@
 #define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6019	0x6019
 #define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_602E	0x602e
 #define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6093	0x6093
+#define USB_DEVICE_ID_LENOVO_LEGION_GO_DUAL_DINPUT	0x6184
+#define USB_DEVICE_ID_LENOVO_LEGION_GO2_DUAL_DINPUT	0x61ed
 
 #define USB_VENDOR_ID_LETSKETCH		0x6161
 #define USB_DEVICE_ID_WP9620N		0x4d15
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index 9bf9ce8dc8032..90be93bdb0895 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -124,6 +124,8 @@ static const struct hid_device_id hid_quirks[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X_V2), HID_QUIRK_MULTI_INPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_PENSKETCH_T609A), HID_QUIRK_MULTI_INPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_ODDOR_HANDBRAKE), HID_QUIRK_ALWAYS_POLL },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_LEGION_GO_DUAL_DINPUT), HID_QUIRK_MULTI_INPUT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_LEGION_GO2_DUAL_DINPUT), HID_QUIRK_MULTI_INPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_OPTICAL_USB_MOUSE_600E), HID_QUIRK_ALWAYS_POLL },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D), HID_QUIRK_ALWAYS_POLL },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6019), HID_QUIRK_ALWAYS_POLL },
-- 
2.50.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help