From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f170.google.com (mail-dy1-f170.google.com [74.125.82.170]) (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 2A18E126F0A for ; Sat, 24 Jan 2026 01:49:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769219354; cv=none; b=RY9zSndUiy4ZDlS7XrP4gonnSytSgq63SDfVItFTDhBNRdDlllcoXjo5gMQ23wwK/Ex1z0vpLfFxu7gtuwi826irjq5zzBVFNYMDP8T7LppR4KCBOjnKG03iViFN69gNLVYV6CuLUBUYWmCxcOOQuXznE7z6FEFoRyiC6RfHyqg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769219354; c=relaxed/simple; bh=Iz/O24RRXRopA/iYdltADd1JWiRCy/cbu+LwfrkUwAw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hAxsYKwjwTc34E6Qb5Sa6yczgDE1bTM+fdPCXhrxk1pSOqh76MF0MWza3uisFbSVEhvS6MatZD/0Z2Man0p4uWqgjU7rBQoRCdLr8gaq/1sBHXbm3+rV+tYU5ZbsoUYCzHbNWQpHUWSJtB4n2+PRKHoHwQgzWyLcX+aYHp9gntw= 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=cGaagszN; arc=none smtp.client-ip=74.125.82.170 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="cGaagszN" Received: by mail-dy1-f170.google.com with SMTP id 5a478bee46e88-2b4520f6b32so4540708eec.0 for ; Fri, 23 Jan 2026 17:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769219352; x=1769824152; 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=Uo6jHEB3ezzd+BlMZazV0yjnUEyUOn6k4aOM+PmOEkM=; b=cGaagszNxVMFiSgF8MuB2EjFKKMtEHfjVJl99s2cLFrSGV66ItGwhAckoHwVN7phN4 8P/L8wQ/b0U9LyAuNsdxRCG+w74g4frGfaSmkxMAzhIZk5wtN8tGpas89w83mrYitUdZ IomeE41Xs3KXNVq89guZFaRm7iWi3Cyzh6Pf+3rWG6/a4BvQ8chA17cIc8AH/zadEG+0 Ahy7o88W4Cmxbs+2lugORLbHr2N2euOWExT4mh4xNwKvGtobDbR8eFCUaZGBWfezo5Vr MYO8f2ExIIcgbvyCwROHhk77GIKyQ3Xpzrn6bi5iyE7iCBLqHJ4AKV6QULkNtRX210q/ To4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769219352; x=1769824152; 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=Uo6jHEB3ezzd+BlMZazV0yjnUEyUOn6k4aOM+PmOEkM=; b=QaniCulrbjK9sRr6vDWE6EB68Wg24iabl7851Jt0+qED17fVIXtmVhbPVlkh6AYjPX I5iNhrBnSsmJYfPrwL+WmeqlnR7Wj9+s8waO2+8Xs9ZecJJvSSKQHPz0rVJnkwX42Qz/ HewKgMvhrxxPYMkcod1kXXSV2ukhP63uQaX6rvexq6L5FSqUQKpa1i/gV680PVSbo6i6 AZtzQwpMNBNuzJcckMKSUvGt7aA1dIk0GxuYRxCKcKISrelneK+YGi+0MraK0VOdUZTP DED0+TdekcaukOAoL29eSfL6B2kuuysCfISxyWoFZO6T9dZ6eIVn3E9apYxYyEZK+u0k TKog== X-Forwarded-Encrypted: i=1; AJvYcCWr7L7nWkS9ms8MAXaEDqFf0fGF37huSFQyXWTRKktpS9oUyv+9JG/OSgTHeaeIrN+3shG3JWsl/B3mYkY=@vger.kernel.org X-Gm-Message-State: AOJu0YyHNNCeU6peBzgMbzF1FcUxIlS8NTj/0C40ARgHRY9eDym5Xqyx CT5vdnnHeC5xXesaVht7WQQcKU/v47ab4lUcpUXY4HuAMifZ7kYwcLVt X-Gm-Gg: AZuq6aLTXKRuPcGhYJGq1YFjPesfD5f7YG4+Gi2zEc5NOgsej2t9sePLtGvj2XJx/n6 qE7H53or3qKKyQhdArkCfFHRSXZhKLCEPXTlomu0PR+RWmuCc6toNXG6lENApIG8gEdo7NVdmga SZxAf+/Oe0rxkbtgHf3kT2ZpBXsCJTIOuJX9W6Ha8CpE94iMhUVtdfh/dRq4jL7JZGrBcjNeOtV KGFKhfGdrTFHAHW7b0h3usb2JzgMf3TqRFY0G3Ng40vw6+igUKGhnlK5WYliaxeZ7ZkISGbX0vT v8XugaqMaBt2EEdFm21bgU3LntJiAJNcpwTsPSQJzrsf1hXEQ4tgQvrJ0xcCo81QpbNMhuKnz/h VhHvcSOpr/CL0z6j7ijpCDDrqv591HsBMJ7J9cOWbg2B9+Ad5Te78EzaNjHsKQuKolOrtf4u5DA zWz9wNaRodqU4482Rri5BO9+0ZSs86X0unmoDLiaP9VD7S+/qKAoDuK942NrcoHaY= X-Received: by 2002:a05:7300:8183:b0:2b6:b23b:d488 with SMTP id 5a478bee46e88-2b739b71186mr3129087eec.25.1769219352182; Fri, 23 Jan 2026 17:49:12 -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-2b73aa22707sm5160014eec.29.2026.01.23.17.49.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jan 2026 17:49:11 -0800 (PST) From: "Derek J. Clark" To: Jiri Kosina , Benjamin Tissoires Cc: 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 v3 00/16] HID: Add Legion Go and Go S Drivers Date: Sat, 24 Jan 2026 01:48:51 +0000 Message-ID: <20260124014907.991265-1-derekjohn.clark@gmail.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@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 Signed-off-by: Derek J. Clark --- Change Log V3: - 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 - Drop the arbitrary uevent properties patch - Add Go serires 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 | 1577 +++++++++++ drivers/hid/hid-lenovo-go.c | 2399 +++++++++++++++++ include/linux/device.h | 46 + include/linux/hid.h | 1 + 11 files changed, 5100 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