Skip to content

Commit 51cc1c4

Browse files
author
Jiri Kosina
committed
Merge branch 'for-7.1/lenovo-v2' into for-linus
- new driver for Lenovo Legion Go / S devices (Derek J. Clark)
2 parents a3922c8 + 19acad7 commit 51cc1c4

11 files changed

Lines changed: 5127 additions & 2 deletions

File tree

Documentation/ABI/testing/sysfs-driver-hid-lenovo-go

Lines changed: 724 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 304 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,304 @@
1+
What: /sys/class/leds/go_s:rgb:joystick_rings/effect
2+
Date: April 2026
3+
Contact: linux-input@vger.kernel.org
4+
Description: This controls the display effect of the RGB interface.
5+
6+
Values are monocolor, breathe, chroma, or rainbow.
7+
8+
Applies to Lenovo Legion Go S line of handheld devices.
9+
10+
What: /sys/class/leds/go_s:rgb:joystick_rings/effect_index
11+
Date: April 2026
12+
Contact: linux-input@vger.kernel.org
13+
Description: This displays the available options for the effect attribute.
14+
15+
Values are monocolor, breathe, chroma, or rainbow.
16+
17+
Applies to Lenovo Legion Go S line of handheld devices.
18+
19+
What: /sys/class/leds/go_s:rgb:joystick_rings/enabled
20+
Date: April 2026
21+
Contact: linux-input@vger.kernel.org
22+
Description: This controls enabling or disabling the RGB interface.
23+
24+
Values are true or false.
25+
26+
Applies to Lenovo Legion Go S line of handheld devices.
27+
28+
What: /sys/class/leds/go_s:rgb:joystick_rings/enabled_index
29+
Date: April 2026
30+
Contact: linux-input@vger.kernel.org
31+
Description: This displays the available options for the enabled attribute.
32+
33+
Values are true or false.
34+
35+
Applies to Lenovo Legion Go S line of handheld devices.
36+
37+
What: /sys/class/leds/go_s:rgb:joystick_rings/mode
38+
Date: April 2026
39+
Contact: linux-input@vger.kernel.org
40+
Description: This controls the operating mode of the RGB interface.
41+
42+
Values are dynamic or custom. Custom allows setting the RGB effect and color.
43+
Dynamic is a Windows mode for syncing Lenovo RGB interfaces not currently
44+
supported under Linux.
45+
46+
Applies to Lenovo Legion Go S line of handheld devices.
47+
48+
What: /sys/class/leds/go_s:rgb:joystick_rings/mode_index
49+
Date: April 2026
50+
Contact: linux-input@vger.kernel.org
51+
Description: This displays the available options for the mode attribute.
52+
53+
Values are dynamic or custom.
54+
55+
Applies to Lenovo Legion Go S line of handheld devices.
56+
57+
What: /sys/class/leds/go_s:rgb:joystick_rings/profile
58+
Date: April 2026
59+
Contact: linux-input@vger.kernel.org
60+
Description: This controls selecting the configured RGB profile.
61+
62+
Values are 1-3.
63+
64+
Applies to Lenovo Legion Go S line of handheld devices.
65+
66+
What: /sys/class/leds/go_s:rgb:joystick_rings/profile_range
67+
Date: April 2026
68+
Contact: linux-input@vger.kernel.org
69+
Description: This displays the available options for the profile attribute.
70+
71+
Values are 1-3.
72+
73+
Applies to Lenovo Legion Go S line of handheld devices.
74+
75+
What: /sys/class/leds/go_s:rgb:joystick_rings/speed
76+
Date: April 2026
77+
Contact: linux-input@vger.kernel.org
78+
Description: This controls the change rate for the breathe, chroma, and rainbow effects.
79+
80+
Values are 0-100.
81+
82+
Applies to Lenovo Legion Go S line of handheld devices.
83+
84+
What: /sys/class/leds/go_s:rgb:joystick_rings/speed_range
85+
Date: April 2026
86+
Contact: linux-input@vger.kernel.org
87+
Description: This displays the available options for the speed attribute.
88+
89+
Values are 0-100.
90+
91+
Applies to Lenovo Legion Go S line of handheld devices.
92+
93+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/gamepad/auto_sleep_time
94+
Date: April 2026
95+
Contact: linux-input@vger.kernel.org
96+
Description: This controls the sleep timer due to inactivity for the built-in controller.
97+
98+
Values are 0-255.
99+
100+
Applies to Lenovo Legion Go S line of handheld devices.
101+
102+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/gamepad/auto_sleep_time_range
103+
Date: April 2026
104+
Contact: linux-input@vger.kernel.org
105+
Description: This displays the available options for the gamepad/auto_sleep_time attribute.
106+
107+
Values are 0-255.
108+
109+
Applies to Lenovo Legion Go S line of handheld devices.
110+
111+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/gamepad/dpad_mode
112+
Date: April 2026
113+
Contact: linux-input@vger.kernel.org
114+
Description: This controls the operating mode of the built-in controllers D-pad.
115+
116+
Values are 4-way or 8-way.
117+
118+
Applies to Lenovo Legion Go S line of handheld devices.
119+
120+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/gamepad/dpad_mode_index
121+
Date: April 2026
122+
Contact: linux-input@vger.kernel.org
123+
Description: This displays the available options for the gamepad/dpad_mode attribute.
124+
125+
Values are 4-way or 8-way.
126+
127+
Applies to Lenovo Legion Go S line of handheld devices.
128+
129+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/gamepad/mode
130+
Date: April 2026
131+
Contact: linux-input@vger.kernel.org
132+
Description: This controls the operating mode of the built-in controller.
133+
134+
Values are xinput or dinput.
135+
136+
Applies to Lenovo Legion Go S line of handheld devices.
137+
138+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/gamepad/mode_index
139+
Date: April 2026
140+
Contact: linux-input@vger.kernel.org
141+
Description: This displays the available options for the gamepad/mode attribute.
142+
143+
Values are xinput or dinput.
144+
145+
Applies to Lenovo Legion Go S line of handheld devices.
146+
147+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/gamepad/poll_rate
148+
Date: April 2026
149+
Contact: linux-input@vger.kernel.org
150+
Description: This controls the poll rate in Hz of the built-in controller.
151+
152+
Values are 125, 250, 500, or 1000.
153+
154+
Applies to Lenovo Legion Go S line of handheld devices.
155+
156+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/gamepad/poll_rate_index
157+
Date: April 2026
158+
Contact: linux-input@vger.kernel.org
159+
Description: This displays the available options for the gamepad/poll_rate attribute.
160+
161+
Values are 125, 250, 500, or 1000.
162+
163+
Applies to Lenovo Legion Go S line of handheld devices.
164+
165+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/imu/bypass_enabled
166+
Date: April 2026
167+
Contact: linux-input@vger.kernel.org
168+
Description: This controls enabling or disabling the IMU bypass function. When enabled the IMU data is directly reported to the OS through
169+
an HIDRAW interface.
170+
171+
Values are true or false.
172+
173+
Applies to Lenovo Legion Go S line of handheld devices.
174+
175+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/imu/bypass_enabled_index
176+
Date: April 2026
177+
Contact: linux-input@vger.kernel.org
178+
Description: This displays the available options for the imu/bypass_enabled attribute.
179+
180+
Values are true or false.
181+
182+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/imu/manufacturer
183+
Date: April 2026
184+
Contact: linux-input@vger.kernel.org
185+
Description: This displays the manufacturer of the intertial measurment unit.
186+
187+
Values are Bosch or ST.
188+
189+
Applies to Lenovo Legion Go S line of handheld devices.
190+
191+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/imu/sensor_enabled
192+
Date: April 2026
193+
Contact: linux-input@vger.kernel.org
194+
Description: This controls enabling or disabling the IMU.
195+
196+
Values are true, false, or wake-2s.
197+
198+
Applies to Lenovo Legion Go S line of handheld devices.
199+
200+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/imu/sensor_enabled_index
201+
Date: April 2026
202+
Contact: linux-input@vger.kernel.org
203+
Description: This displays the available options for the imu/sensor_enabled attribute.
204+
205+
Values are true, false, or wake-2s.
206+
207+
Applies to Lenovo Legion Go S line of handheld devices.
208+
209+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/mcu_id
210+
Date: April 2026
211+
Contact: linux-input@vger.kernel.org
212+
Description: This displays the MCU Identification Number
213+
214+
Applies to Lenovo Legion Go S line of handheld devices.
215+
216+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/mouse/step
217+
Date: April 2026
218+
Contact: linux-input@vger.kernel.org
219+
Description: This controls which value is used for the mouse sensitivity.
220+
221+
Values are 1-127.
222+
223+
Applies to Lenovo Legion Go S line of handheld devices.
224+
225+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/mouse/step_range
226+
Date: April 2026
227+
Contact: linux-input@vger.kernel.org
228+
Description: This displays the available options for the mouse/step attribute.
229+
230+
Values are 1-127.
231+
232+
Applies to Lenovo Legion Go S line of handheld devices.
233+
234+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/os_mode
235+
Date: April 2026
236+
Contact: linux-input@vger.kernel.org
237+
Description: This controls which value is used for the touchpads operating mode.
238+
239+
Values are windows or linux.
240+
241+
Applies to Lenovo Legion Go S line of handheld devices.
242+
243+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/os_mode_index
244+
Date: April 2026
245+
Contact: linux-input@vger.kernel.org
246+
Description: This displays the available options for the os_mode attribute.
247+
248+
Values are windows or linux.
249+
250+
Applies to Lenovo Legion Go S line of handheld devices.
251+
252+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/touchpad/enabled
253+
Date: April 2026
254+
Contact: linux-input@vger.kernel.org
255+
Description: This controls enabling or disabling the built-in touchpad.
256+
257+
Values are true or false.
258+
259+
Applies to Lenovo Legion Go S line of handheld devices.
260+
261+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/touchpad/enabled_index
262+
Date: April 2026
263+
Contact: linux-input@vger.kernel.org
264+
Description: This displays the available options for the touchpad/enabled attribute.
265+
266+
Values are true or false.
267+
268+
Applies to Lenovo Legion Go S line of handheld devices.
269+
270+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/touchpad/linux_mode
271+
Date: April 2026
272+
Contact: linux-input@vger.kernel.org
273+
Description: This controls behavior of the touchpad events when os_mode is set to linux.
274+
275+
Values are absolute or relative.
276+
277+
Applies to Lenovo Legion Go S line of handheld devices.
278+
279+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/touchpad/linux_mode_index
280+
Date: April 2026
281+
Contact: linux-input@vger.kernel.org
282+
Description: This displays the available options for the touchpad/linux_mode attribute.
283+
284+
Values are absolute or relative.
285+
286+
Applies to Lenovo Legion Go S line of handheld devices.
287+
288+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/touchpad/windows_mode
289+
Date: April 2026
290+
Contact: linux-input@vger.kernel.org
291+
Description: This controls behavior of the touchpad events when os_mode is set to windows.
292+
293+
Values are absolute or relative.
294+
295+
Applies to Lenovo Legion Go S line of handheld devices.
296+
297+
What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/touchpad/windows_mode_index
298+
Date: April 2026
299+
Contact: linux-input@vger.kernel.org
300+
Description: This displays the available options for the touchpad/windows_mode attribute.
301+
302+
Values are absolute or relative.
303+
304+
Applies to Lenovo Legion Go S line of handheld devices.

MAINTAINERS

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14469,6 +14469,17 @@ L: platform-driver-x86@vger.kernel.org
1446914469
S: Maintained
1447014470
F: drivers/platform/x86/lenovo/wmi-hotkey-utilities.c
1447114471

14472+
LENOVO HID drivers
14473+
M: Derek J. Clark <derekjohn.clark@gmail.com>
14474+
M: Mark Pearson <mpearson-lenovo@squebb.ca>
14475+
L: linux-input@vger.kernel.org
14476+
S: Maintained
14477+
F: Documentation/ABI/testing/sysfs-driver-hid-lenovo-go
14478+
F: Documentation/ABI/testing/sysfs-driver-hid-lenovo-go-s
14479+
F: drivers/hid/hid-lenovo-go-s.c
14480+
F: drivers/hid/hid-lenovo-go.c
14481+
F: drivers/hid/hid-lenovo.c
14482+
1447214483
LETSKETCH HID TABLET DRIVER
1447314484
M: Hans de Goede <hansg@kernel.org>
1447414485
L: linux-input@vger.kernel.org

drivers/hid/Kconfig

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,7 @@ config HID_LED
601601

602602
config HID_LENOVO
603603
tristate "Lenovo / Thinkpad devices"
604-
select NEW_LEDS
605-
select LEDS_CLASS
604+
depends on LEDS_CLASS
606605
help
607606
Support for IBM/Lenovo devices that are not fully compliant with HID standard.
608607

@@ -614,6 +613,28 @@ config HID_LENOVO
614613
- ThinkPad Compact Bluetooth Keyboard with TrackPoint (supports Fn keys)
615614
- ThinkPad Compact USB Keyboard with TrackPoint (supports Fn keys)
616615

616+
config HID_LENOVO_GO
617+
tristate "HID Driver for Lenovo Legion Go Series Controllers"
618+
depends on USB_HID
619+
depends on LEDS_CLASS_MULTICOLOR
620+
help
621+
Support for Lenovo Legion Go devices with detachable controllers.
622+
623+
Say Y here to include configuration interface support for the Lenovo Legion Go
624+
and Legion Go 2 Handheld Console Controllers. Say M here to compile this
625+
driver as a module. The module will be called hid-lenovo-go.
626+
627+
config HID_LENOVO_GO_S
628+
tristate "HID Driver for Lenovo Legion Go S Controller"
629+
depends on USB_HID
630+
depends on LEDS_CLASS_MULTICOLOR
631+
help
632+
Support for Lenovo Legion Go S Handheld Console Controller.
633+
634+
Say Y here to include configuration interface support for the Lenovo Legion Go
635+
S. Say M here to compile this driver as a module. The module will be called
636+
hid-lenovo-go-s.
637+
617638
config HID_LETSKETCH
618639
tristate "Letsketch WP9620N tablets"
619640
depends on USB_HID

drivers/hid/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ obj-$(CONFIG_HID_KYE) += hid-kye.o
7676
obj-$(CONFIG_HID_KYSONA) += hid-kysona.o
7777
obj-$(CONFIG_HID_LCPOWER) += hid-lcpower.o
7878
obj-$(CONFIG_HID_LENOVO) += hid-lenovo.o
79+
obj-$(CONFIG_HID_LENOVO_GO) += hid-lenovo-go.o
80+
obj-$(CONFIG_HID_LENOVO_GO_S) += hid-lenovo-go-s.o
7981
obj-$(CONFIG_HID_LETSKETCH) += hid-letsketch.o
8082
obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o
8183
obj-$(CONFIG_HID_LOGITECH) += hid-lg-g15.o

drivers/hid/hid-core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2895,6 +2895,11 @@ static int hid_uevent(const struct device *dev, struct kobj_uevent_env *env)
28952895
if (add_uevent_var(env, "MODALIAS=hid:b%04Xg%04Xv%08Xp%08X",
28962896
hdev->bus, hdev->group, hdev->vendor, hdev->product))
28972897
return -ENOMEM;
2898+
if (hdev->firmware_version) {
2899+
if (add_uevent_var(env, "HID_FIRMWARE_VERSION=0x%04llX",
2900+
hdev->firmware_version))
2901+
return -ENOMEM;
2902+
}
28982903

28992904
return 0;
29002905
}

0 commit comments

Comments
 (0)