From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f173.google.com (mail-dy1-f173.google.com [74.125.82.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA9E126E165 for ; Fri, 20 Feb 2026 07:05:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771571158; cv=none; b=LKbEVeFesEHOqXO2S/76YB86s952LCN0paPwn76mulWSrhKfIVSjBNwk0FygOdEDPgB4WJ0lJLYTIvL0FU+je+/L82Sre3hJFRgvdmPv5xwKNr2SzoDIFJCBdOTIbOBuXQxabkADnorZLiTe+Dm8zAOGl2eQL4mxWslJ0eAOs/M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771571158; c=relaxed/simple; bh=m4HDAOcKPODaBXvsaq62AV5hGzCNMN403tNNb4nzSBI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hlaUX+fTjOdO/ssZJVGvj1HzxzO7XOGeEDiy0JqzJUIJGTZOhPGQ5ABOeVep/IWg9ltmZbmIYpxDHQYCJzthUzz5C3khDiL1MD4fhIuxfz8h0ZKJ+GCLrDPZ1yRPcofuxbdtAVn305SmfkvnNx0cR081kws99l/uAbMnfgV/y90= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GK6Z6+7G; arc=none smtp.client-ip=74.125.82.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GK6Z6+7G" Received: by mail-dy1-f173.google.com with SMTP id 5a478bee46e88-2bd3b0bc201so4106212eec.1 for ; Thu, 19 Feb 2026 23:05:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771571156; x=1772175956; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LlJFw9o/nUtRdl6k0ZyQShyhGYr3G6NcBejagNa77zc=; b=GK6Z6+7GA4pgLKQqZMuN5lcc0v1ZCwqVRauglq7uQ1ygxJ3X1O2KweCGROhRMlwxKJ j0Ze0UCfpjXghNYdIRB3DLJzcrwN3k1Rl0j2hBVHVYwKNS2n02iwl9B4vdQcopnHEPCW /JFSztyd43/5WlJORmrvRhepTuloUBXMqFhPS/s+FJ3FJiatqiSTxz/z+iFUQW13KTaM iFaRXxz7gOk+DULkOk68BvFG3ELnly1BsJzNngTg4aYbbphXzP0oKsE92k/zU2zeJPz2 Dok/aw4GBDqnKMnziRHvWW19rmY13LVmB0NkrMgDlDorVhmlenAFEHYnMdYaD7bdbORZ LAaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771571156; x=1772175956; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=LlJFw9o/nUtRdl6k0ZyQShyhGYr3G6NcBejagNa77zc=; b=BfyQMV7JXA8acEmGZE+Cm6ASG0EG4nuQGCITbxHA5c+Q+y6ZdppGzlX+smIJGWPdi1 a5O5SBn2T4JvVPHN0/iDmzT7fEs3kEfNk/GvRyPjOn9bDHIcCAQZBxByvmuLox370xpq 0T5ewxcehYs9iHVm4upFKqyJj4eNdghCQ9tj0sI+AhT/gMVqfQTednnE4cRCJaSU8+GJ gk4+DLHGNMl6mkxr21OOY7lnuwbfOa3qNvjTnr+cUGLeYYhrGlUekF3jyHMf7WAEyhHE ya2n6gzceCErarOwsTIfBICXTIl1U4YjlQfyWM/9cp1Eu6rNN5j8TBCMA9zgbAOrjl5X WuxA== X-Forwarded-Encrypted: i=1; AJvYcCVbDRzPhjYEqODY1co+33iRLWg1lOFCM1gKIMC1X/lFOl6nH5Ckw61W6rxu0qOAXWyo8hry9UJs3NSrvw==@vger.kernel.org X-Gm-Message-State: AOJu0YzUePV/t8qDgNmiAlLjc4EK8kNU69WcNufyEumH4CIYAS5WelMz HhaNonqcSXu1TokkJSeWOP5XfZMhc2jItUWG9oO/pov7aF2lD/qMCN0t X-Gm-Gg: AZuq6aLRtFyXTEcUeyqVg6f6bgO4r8CQJA9ZWV6sE8NhZ1V9w41Je2+eioNJ/AQbc1q SQ0BZVRWHs6Q3ellfEu96vgRDAhEY8CxPK8PT3OxnJ+HWI5xLSqH/uKp5QZU+sQR723Qaem0aJg 1hG5w+KrGaq4qsdZrtqOT75RxzrP3is5Uo8YdkbFe7j3KCYDaLO89kWCN/JBBmfpaoALUtDJ42Z 19wd7om6AmFZJ7ZFmIMgIQ2zxq9vizuStNdHRtjlKzQUEUu4Ds/UQ2hKvofR/Jafkooa4C+fGL6 sAaQZvT4AfJcsMPQg42bqdsrBlSNS6GVJ4MLCgb6WFeSPpxtMLZuFtU7xwBWwC6kDakiXE2xpEa bMRYgAPBzG0kdUkSvlCaJQrxdB+bq+HeYgQMGlD2aqyK9kySEk/1aQwiROWbuQu3kyq9IWPHeYc FWvdelzZghsPhek96yzSTyrLn0P0VB8F5cZORm1qnc2rgFpv6epcjlaanuhkMjYZ2yzkUoBWFoO yI= X-Received: by 2002:a05:7301:7bc4:b0:2b8:2910:dcae with SMTP id 5a478bee46e88-2bd5b2b1460mr3330150eec.13.1771571155744; Thu, 19 Feb 2026 23:05:55 -0800 (PST) Received: from lappy (108-228-232-20.lightspeed.sndgca.sbcglobal.net. [108.228.232.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2bacb669f7dsm22163335eec.23.2026.02.19.23.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Feb 2026 23:05:55 -0800 (PST) From: "Derek J. Clark" To: Jiri Kosina , Benjamin Tissoires Cc: Richard Hughes , Mario Limonciello , Zhixin Zhang , Mia Shao , Mark Pearson , "Pierre-Loup A . Griffais" , "Derek J . Clark" , linux-input@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 00/16] HID: Add Legion Go and Go S Drivers Date: Fri, 20 Feb 2026 07:05:13 +0000 Message-ID: <20260220070533.4083667-1-derekjohn.clark@gmail.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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[1]. 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 his-asus-ally driver[2] use this macro to simplify the sysfs by removing redundancy. An upcoming out of tree driver for the Zotac Zone [3] 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. Finally, there are some checkpatch warnings that will need to be supressed: WARNING: ENOSYS means 'invalid syscall nr' and nothing else 1292: FILE: drivers/hid/lenovo-legos-hid/lenovo-legos-hid-config.c:1085: + case -ENOSYS: /* during rmmod -ENOSYS is expected */ This error handling case was added as it is experienced in the real world when the driver is rmmod. The LED subsystem produces this error code in its legacy code and this is not a new novel use of -ENOSYS, we are simply catching the case to avoid spurious errors in dmesg when the drivers are removed. [1]: https://github.com/ShadowBlip/InputPlumber/tree/main/src/drivers/lego [2]: https://lore.kernel.org/all/20240806081212.56860-1-luke@ljones.dev/ [3]: https://github.com/flukejones/linux/tree/wip/zotac-zone-6.15/drivers/hid/zotac-zone-hid Reviewed-by: Mark Pearson Signed-off-by: Derek J. Clark --- Change Log v4: - Use dmabuf allocated per request for both drivers instead of a devm preallocated buffer that is reused. This solves a bug where some attributes couldn't be restored without manual writing after resume. - Reduce the number of quirks and flags in the Go S init to only those necessary. Previously they were duplicated from the Go driver but everything except HID_CONNECT_HIDRAW was found to be unnessary during operational testing. - Clean up formatting for debug prints in Go S driver. - Fix bugs in RGB driver for Go that caused the effect to switch to solid when the speed or brightness was changed. - Remove extraneous setting of os_mode member of drvdata when setting os_mode. It will be read from the hardware in _show. v3: https://lore.kernel.org/linux-input/20260124014907.991265-1-derekjohn.clark@gmail.com/ - Fix Documentation formatting by removing extra + characters. - Fix bugs in hid-lenovo-go-s IMU & TP RO attributes being tied to the wrong _show function. - Rename enume os_mode_index to os_mode_types_index to fix collision with os_mode_index attribute. - Remove accidental rename for enabled->enable attributes in patch 4 - Add SOB for Mario in patch 10 as Co-Developer. v2: https://lore.kernel.org/linux-input/20251229031753.581664-1-derekjohn.clark@gmail.com/ - Break up adding the Go S driver into feature specific patches. - Rename Go S driver from lenovo-legos-hid to hid-lenovo-go-s and move it out of a subdirectory. - Drop the arbitrary uevent properties patch. - Add Go series driver. - Move DEVICE_ATTR_NAMED macros to device.h. v1: https://lore.kernel.org/linux-input/20250703004943.515919-1-derekjohn.clark@gmail.com/ Derek J. Clark (15): include: device.h: Add named device attributes HID: hid-lenovo-go: Add Lenovo Legion Go Series HID Driver HID: hid-lenovo-go: Add Feature Status Attributes HID: hid-lenovo-go: Add Rumble and Haptic Settings HID: hid-lenovo-go: Add FPS Mode DPI settings HID: hid-lenovo-go: Add RGB LED control interface HID: hid-lenovo-go: Add Calibration Settings HID: hid-lenovo-go: Add OS Mode Toggle HID: hid-lenovo-go-s: Add Lenovo Legion Go S Series HID Driver HID: hid-lenovo-go-s: Add MCU ID Attribute HID: hid-lenovo-go-s: Add Feature Status Attributes HID: hid-lenovo-go-s: Add Touchpad Mode Attributes HID: hid-lenovo-go-s: Add RGB LED control interface HID: hid-lenovo-go-s: Add IMU and Touchpad RO Attributes HID: Add documentation for Lenovo Legion Go drivers Mario Limonciello (1): HID: Include firmware version in the uevent .../ABI/testing/sysfs-driver-hid-lenovo-go | 724 +++++ .../ABI/testing/sysfs-driver-hid-lenovo-go-s | 304 +++ MAINTAINERS | 11 + drivers/hid/Kconfig | 24 + drivers/hid/Makefile | 2 + drivers/hid/hid-core.c | 5 + drivers/hid/hid-ids.h | 7 + drivers/hid/hid-lenovo-go-s.c | 1586 +++++++++++ drivers/hid/hid-lenovo-go.c | 2403 +++++++++++++++++ include/linux/device.h | 46 + include/linux/hid.h | 1 + 11 files changed, 5113 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-hid-lenovo-go create mode 100644 Documentation/ABI/testing/sysfs-driver-hid-lenovo-go-s create mode 100644 drivers/hid/hid-lenovo-go-s.c create mode 100644 drivers/hid/hid-lenovo-go.c -- 2.52.0