mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Keyboard backlight for the Lenovo Legion Pro 7 Gen 10
@ 2026-11-27  1:11 Ciro Pedrini via B4 Relay
  2026-11-27  1:11 ` [PATCH v3 1/2] platform/x86: ideapad-laptop: Ignore keyboard backlight hotkeys Ciro Pedrini via B4 Relay
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Ciro Pedrini via B4 Relay @ 2026-11-27  1:11 UTC (permalink / raw)
  To: Mark Pearson, Derek J. Clark, Rong Zhang, Ike Panhc,
	Hans de Goede, Ilpo Järvinen, Jiri Kosina,
	Benjamin Tissoires
  Cc: David Cemin, Werner Sembach, Aaron Erhardt, platform-driver-x86,
	linux-kernel, linux-input, Ciro Pedrini

Hi,

This is v3 of the Legion keyboard backlight series. It has the changes
Ilpo and Rong asked for on v2, and one fix I found while testing them.

Short background: on my laptop the keyboard backlight never turned on
under Linux. The keyboard controller (048d:c197) stores a brightness from
0 to 9 behind a vendor feature report (0x07), it was 0 from the factory,
and nothing on Linux could change it. That brightness dims every LED of
the machine. Fn+Up/Down/Space are handled by the firmware, which sends
the new level on a vendor input report.

Patch 1 stops ideapad-laptop from sending KEY_UNKNOWN for those three
keys. Patch 2 is the driver: the brightness as a kbd_backlight LED, plus
brightness_hw_changed for the hotkeys so the desktop OSD works.

The fix: while testing v3 I found that the controller sends the same
"brightness is now B" report after every brightness set, the host's
own ones too, and also when the level doesn't change (Fn+Space sends
it as well). v2 passed all of those to brightness_hw_changed, so the
host's writes looked like hardware changes. v3 only reports a level
that differs from the last one the driver knows.

David: patch 1 adds three KE_IGNORE entries to the ideapad WMI keymap,
which your "architecture independent home for the Lenovo WMI drivers"
series moves to wmi-fn-keys.c. Whichever goes first, I'm happy to
rebase mine on yours; it's the same three lines in the new file.

I tested it on my 16IAX10H (83F5, BIOS Q7CN77WW) with 7.3 as a module:
brightness from sysfs and KDE, the hotkeys and the OSD, Fn+Space,
suspend/resume, unbind and rebind, and the vendor report on the wire
while doing that. It's based on pdx86 for-next and builds with W=1.

About how this was made: I found the protocol with usbmon captures and
by looking at Lenovo's Windows software. I wrote the code with help from
Claude Code (Claude Opus 5.5). I went through all of it and tested it
myself, and each patch has a short note about it below the ---.

Thanks,
Ciro

---
Changes in v3:
- Short reports: send only the request bytes and read only the answer
  bytes, right after the request; no more 100 ms wait (Rong).
- The buffer is allocated per exchange. Not on the stack as Rong
  suggested: usbhid hands it to the USB core for DMA.
- legion_raw_command() and legion_simple_command(), and the request
  length checked against the 960-byte report with a static_assert
  (Rong).
- Out-of-range values and failed reads return errors instead of being
  clamped or replaced; dbg messages, no hex dump (Ilpo, Rong).
- devm for hid_hw_start()/hid_hw_open() and the LED; .remove stays,
  empty, so hid-core doesn't stop the device twice (Ilpo, Rong).
- Dropped the (int) casts and the "(2025)"; comments trimmed, the one
  about HID_QUIRK_INPUT_PER_APP now says why; Kconfig help about what
  the driver does (Ilpo, Rong).
- New: only report a level change to brightness_hw_changed (see above).
- Rebased on current pdx86 for-next; Rong's Acked-by on patch 1.
- Link to v2: https://lore.kernel.org/r/20261110-legion-lighting-rfc-v2-0-845726afb71c@gmail.com

Changes in v2:
- Only the keyboard controller (c197) now, as Rong suggested. No
  LampArray, no colours, no lighting_mode, just a kbd_backlight LED.
- Ilpo's comments: struct with __le16 for the request, guard(),
  devm_mutex_init(), no magic numbers, includes.
- Removed the "ready" flag, its spinlock and the work item. raw_event
  can't run during probe/remove, so it notifies the LED directly.
- Keep led_cdev.brightness in sync with the hotkeys (from the Sashiko
  review).
- Moved the note about the AI tool out of the changelogs, below the ---.
- Link to v1: https://lore.kernel.org/r/20261109-legion-lighting-rfc-v1-0-a87e1db8c5e3@gmail.com

---
Ciro Pedrini (2):
      platform/x86: ideapad-laptop: Ignore keyboard backlight hotkeys
      HID: lenovo-legion: Add keyboard backlight driver for Legion Gen 10

 MAINTAINERS                                  |   1 +
 drivers/hid/Kconfig                          |  12 ++
 drivers/hid/Makefile                         |   1 +
 drivers/hid/hid-ids.h                        |   1 +
 drivers/hid/hid-lenovo-legion.c              | 293 +++++++++++++++++++++++++++
 drivers/platform/x86/lenovo/ideapad-laptop.c |   4 +
 6 files changed, 312 insertions(+)
---
base-commit: 61c0dac952b9308884936d05cce97565a5c89af4
change-id: 20261109-legion-lighting-rfc-dc32165df52d

Best regards,
-- 
Ciro Pedrini <ciro.pedrini@gmail.com>



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 1/2] platform/x86: ideapad-laptop: Ignore keyboard backlight hotkeys
  2026-11-27  1:11 [PATCH v3 0/2] Keyboard backlight for the Lenovo Legion Pro 7 Gen 10 Ciro Pedrini via B4 Relay
@ 2026-11-27  1:11 ` Ciro Pedrini via B4 Relay
  2026-11-27  1:11 ` [PATCH v3 2/2] HID: lenovo-legion: Add keyboard backlight driver for Legion Gen 10 Ciro Pedrini via B4 Relay
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Ciro Pedrini via B4 Relay @ 2026-11-27  1:11 UTC (permalink / raw)
  To: Mark Pearson, Derek J. Clark, Rong Zhang, Ike Panhc,
	Hans de Goede, Ilpo Järvinen, Jiri Kosina,
	Benjamin Tissoires
  Cc: David Cemin, Werner Sembach, Aaron Erhardt, platform-driver-x86,
	linux-kernel, linux-input, Ciro Pedrini

From: Ciro Pedrini <ciro.pedrini@gmail.com>

On the Legion Pro 7 16IAX10H, Fn+Space (backlight effect), Fn+Up and
Fn+Down (backlight brightness) emit WMI fn-key events 0x21, 0x1a and
0x19, which the keymap does not cover, so they reach userspace as
KEY_UNKNOWN. The keyboard's USB controller handles these keys itself: it
switches the effect or changes the brightness, and reports the new level
on its own HID interface. Ignore the three events, as is already done for
FnLock and Esc, rather than mapping them to KEY_KBDILLUM*, which would
make userspace change the brightness a second time.

Tested on the 16IAX10H with 7.2: with the change, evtest shows no events
for the three keys, and the keyboard still switches the effect and the
brightness.

Acked-by: Rong Zhang <i@rong.moe>
Signed-off-by: Ciro Pedrini <ciro.pedrini@gmail.com>
---
Prepared with Claude Code (Claude Opus 5.5) from evtest on the laptop's
"Ideapad extra buttons" device; I reviewed and tested it.
---
 drivers/platform/x86/lenovo/ideapad-laptop.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/platform/x86/lenovo/ideapad-laptop.c b/drivers/platform/x86/lenovo/ideapad-laptop.c
index d2344dcd6945..dbb54d2c7c40 100644
--- a/drivers/platform/x86/lenovo/ideapad-laptop.c
+++ b/drivers/platform/x86/lenovo/ideapad-laptop.c
@@ -1384,6 +1384,10 @@ static const struct key_entry ideapad_keymap[] = {
 	{ KE_IGNORE,	0x02 | IDEAPAD_WMI_KEY },
 	/* Esc (handled by the firmware) */
 	{ KE_IGNORE,	0x03 | IDEAPAD_WMI_KEY },
+	/* Keyboard backlight down, up and effect (handled by the keyboard) */
+	{ KE_IGNORE,	0x19 | IDEAPAD_WMI_KEY },
+	{ KE_IGNORE,	0x1a | IDEAPAD_WMI_KEY },
+	{ KE_IGNORE,	0x21 | IDEAPAD_WMI_KEY },
 	/* Customizable Lenovo Hotkey ("star" with 'S' inside) */
 	{ KE_KEY,	0x01 | IDEAPAD_WMI_KEY, { KEY_FAVORITES } },
 	{ KE_KEY,	0x04 | IDEAPAD_WMI_KEY, { KEY_SELECTIVE_SCREENSHOT } },

-- 
2.56.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 2/2] HID: lenovo-legion: Add keyboard backlight driver for Legion Gen 10
  2026-11-27  1:11 [PATCH v3 0/2] Keyboard backlight for the Lenovo Legion Pro 7 Gen 10 Ciro Pedrini via B4 Relay
  2026-11-27  1:11 ` [PATCH v3 1/2] platform/x86: ideapad-laptop: Ignore keyboard backlight hotkeys Ciro Pedrini via B4 Relay
@ 2026-11-27  1:11 ` Ciro Pedrini via B4 Relay
  2026-11-28 12:01   ` Rong Zhang
  2026-11-28 12:00 ` [PATCH v3 0/2] Keyboard backlight for the Lenovo Legion Pro 7 " Rong Zhang
  2026-11-28 17:46 ` Marco Giunta
  3 siblings, 1 reply; 7+ messages in thread
From: Ciro Pedrini via B4 Relay @ 2026-11-27  1:11 UTC (permalink / raw)
  To: Mark Pearson, Derek J. Clark, Rong Zhang, Ike Panhc,
	Hans de Goede, Ilpo Järvinen, Jiri Kosina,
	Benjamin Tissoires
  Cc: David Cemin, Werner Sembach, Aaron Erhardt, platform-driver-x86,
	linux-kernel, linux-input, Ciro Pedrini

From: Ciro Pedrini <ciro.pedrini@gmail.com>

The keyboard backlight of the Lenovo Legion Pro 7 16IAX10H (2025) has no
Linux support: on the test unit nothing ever lit, because the keyboard
controller's brightness was 0 from the factory and nothing exposes it.

The ITE 8258 keyboard controller (048d:c197) is the built-in keyboard and
carries a vendor protocol on feature report 0x07 (up to 960 bytes): a
request, answered by reading the report back. Its hardware brightness,
0..9, is stored in the controller and applies to every LED of the machine
(keys, front strip, rear vents, lid logo). The firmware handles Fn+Up and
Fn+Down itself and reports the new level on vendor input report 5; it
reports every other set there too, the host's and unchanged ones
included.

Expose the brightness as a kbd_backlight LED, legion::kbd_backlight, with
brightness_hw_changed for the hotkeys so that desktops show their OSD.
Only a change of the level is reported there, so the host's own sets and
Fn+Space, which come back with the level already known, are not.
Unregistering keeps the level (LED_RETAIN_AT_SHUTDOWN): switching it off
would be stored by the controller.

The colours stay the controller's own effects, which Fn+Space cycles. The
machine's HID LampArray (048d:c193) is left to hid-generic, or to a
generic LampArray driver.

Tested on the 16IAX10H (83F5) with 7.3 as a module: brightness from sysfs
and KDE, the hotkeys with KDE's OSD, suspend/resume, unbinding and
rebinding.

Signed-off-by: Ciro Pedrini <ciro.pedrini@gmail.com>
---
Prepared with Claude Code (Claude Opus 5.5) from measurements on the
laptop (usbmon captures) and analysis of the vendor's Windows software
for interoperability; I reviewed and tested it.
---
 MAINTAINERS                     |   1 +
 drivers/hid/Kconfig             |  12 ++
 drivers/hid/Makefile            |   1 +
 drivers/hid/hid-ids.h           |   1 +
 drivers/hid/hid-lenovo-legion.c | 293 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 308 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index ba7650cb86b0..6c622b50ac9b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15187,6 +15187,7 @@ F:	Documentation/ABI/testing/sysfs-driver-hid-lenovo-go
 F:	Documentation/ABI/testing/sysfs-driver-hid-lenovo-go-s
 F:	drivers/hid/hid-lenovo-go-s.c
 F:	drivers/hid/hid-lenovo-go.c
+F:	drivers/hid/hid-lenovo-legion.c
 F:	drivers/hid/hid-lenovo.c
 
 LENOVO YOGA BOOK 9 KEYBOARD DOCK DRIVER
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 2481bc01c435..336be96dcd66 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -652,6 +652,18 @@ config HID_LENOVO_GO_S
 	S. Say M here to compile this driver as a module. The module will be called
 	hid-lenovo-go-s.
 
+config HID_LENOVO_LEGION
+	tristate "Lenovo Legion laptop keyboard backlight"
+	depends on USB_HID
+	depends on LEDS_CLASS
+	help
+	Support for the LEDs of some Lenovo Legion laptops since 2025, with
+	the brightness changes initiated by predefined shortcuts (e.g.,
+	Fn+Up/Down) reported via brightness_hw_changed.
+
+	Say M here to compile this driver as a module. The module will be called
+	hid-lenovo-legion.
+
 config HID_LETSKETCH
 	tristate "Letsketch WP9620N tablets"
 	depends on USB_HID
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 43a8eb0f389b..713bb1c89861 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -78,6 +78,7 @@ obj-$(CONFIG_HID_LCPOWER)	+= hid-lcpower.o
 obj-$(CONFIG_HID_LENOVO)	+= hid-lenovo.o
 obj-$(CONFIG_HID_LENOVO_GO)	+= hid-lenovo-go.o
 obj-$(CONFIG_HID_LENOVO_GO_S)	+= hid-lenovo-go-s.o
+obj-$(CONFIG_HID_LENOVO_LEGION)	+= hid-lenovo-legion.o
 obj-$(CONFIG_HID_LETSKETCH)	+= hid-letsketch.o
 obj-$(CONFIG_HID_LOGITECH)	+= hid-logitech.o
 obj-$(CONFIG_HID_LOGITECH)	+= hid-lg-g15.o
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 91319aa6516d..992b9b147e95 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -773,6 +773,7 @@
 #define USB_DEVICE_ID_ITE_LENOVO_YOGA2  0x8350
 #define I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720	0x837a
 #define USB_DEVICE_ID_ITE_LENOVO_YOGA900	0x8396
+#define USB_DEVICE_ID_ITE_LENOVO_LEGION_GEN10_KBD	0xc197
 #define I2C_DEVICE_ID_ITE_LENOVO_YOGA_SLIM_7X_KEYBOARD	0x8987
 #define I2C_DEVICE_ID_ITE_LENOVO_YOGA_SLIM_7X_G11_KEYBOARD	0x83db
 #define USB_DEVICE_ID_ITE8595		0x8595
diff --git a/drivers/hid/hid-lenovo-legion.c b/drivers/hid/hid-lenovo-legion.c
new file mode 100644
index 000000000000..cfd42c52500f
--- /dev/null
+++ b/drivers/hid/hid-lenovo-legion.c
@@ -0,0 +1,293 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * HID driver for the keyboard backlight of Lenovo Legion laptops.
+ *
+ * The ITE 8258 keyboard controller (048d:c197) is the built-in keyboard and
+ * carries Lenovo's vendor lighting protocol on feature report 0x07 (up to
+ * 960 bytes): a request (struct legion_msg), answered by reading the report
+ * back with a GET_FEATURE. Requests and answers may be shorter than the
+ * report; the answer is ready as soon as the request has been sent.
+ *
+ * The backlight brightness is op 0xCE (set) / 0xCD (get), 0..9, stored in the
+ * controller; it applies to every LED of the machine (keys, front strip, rear
+ * vents, lid logo). The firmware handles Fn+Up / Fn+Down itself and reports
+ * the new level on vendor input report 5 (struct legion_event). It reports
+ * every other set the same way, also the host's and unchanged levels.
+ *
+ * The colours are the controller's own effects. The LEDs can also be handed
+ * to the HID LampArray of the "Lenovo Lighting" device (048d:c193), which
+ * this driver leaves to others.
+ */
+
+#include <linux/build_bug.h>
+#include <linux/cleanup.h>
+#include <linux/container_of.h>
+#include <linux/device.h>
+#include <linux/hid.h>
+#include <linux/leds.h>
+#include <linux/minmax.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/overflow.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+#include <linux/types.h>
+
+#include <asm/byteorder.h>
+#include <asm/rwonce.h>
+
+#include "hid-ids.h"
+
+#define LEGION_REPORT_ID		0x07
+
+#define LEGION_OP_GET_BRIGHTNESS	0xcd
+#define LEGION_OP_SET_BRIGHTNESS	0xce
+#define LEGION_MAX_BRIGHTNESS		9
+
+#define LEGION_EVENT_REPORT_ID		0x05
+#define LEGION_EVENT_BRIGHTNESS		0x02	/* set by the host, Fn+Up, Fn+Space */
+#define LEGION_EVENT_BRIGHTNESS_DOWN	0x03	/* Fn+Down */
+
+/* Request, and its answer: the value is params[0]. */
+struct legion_msg {
+	u8 report_id;
+	u8 op;
+	__le16 len;			/* of params */
+	u8 params[];
+} __packed;
+
+#define LEGION_REPORT_PARAM_SIZE	956
+#define LEGION_REPORT_SIZE		960
+static_assert(struct_size_t(struct legion_msg, params, LEGION_REPORT_PARAM_SIZE) ==
+	      LEGION_REPORT_SIZE);
+
+struct legion_event {
+	u8 report_id;
+	u8 event;
+	u8 level;			/* brightness after the change */
+} __packed;
+
+struct legion_kbd {
+	struct hid_device *hdev;
+	struct mutex lock;		/* one request/answer exchange at a time */
+	struct led_classdev led;
+	u8 level;			/* last level set, read or reported */
+};
+
+/*
+ * Send one request. When @answer is non-NULL, read the controller's answer
+ * and return its value there.
+ */
+static int legion_raw_command(struct legion_kbd *kbd, u8 op, const u8 *params,
+			      size_t len, u8 *answer)
+{
+	size_t get_size = struct_size_t(struct legion_msg, params, 1);
+	size_t set_size = struct_size_t(struct legion_msg, params, len);
+	struct hid_device *hdev = kbd->hdev;
+	int ret;
+
+	if (len > LEGION_REPORT_PARAM_SIZE)
+		return -EINVAL;
+
+	/* Not on the stack: usbhid passes the buffer to the USB core for DMA. */
+	struct legion_msg *msg __free(kfree) =
+		kzalloc_flex(*msg, params, max(len, 1));
+	if (!msg)
+		return -ENOMEM;
+
+	msg->report_id = LEGION_REPORT_ID;
+	msg->op = op;
+	msg->len = cpu_to_le16(len);
+	memcpy(msg->params, params, len);
+
+	guard(mutex)(&kbd->lock);
+
+	ret = hid_hw_raw_request(hdev, LEGION_REPORT_ID, (u8 *)msg, set_size,
+				 HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
+	if (ret < 0)
+		return ret;
+	if (!answer)
+		return 0;
+
+	memset(msg, 0, get_size);
+	ret = hid_hw_raw_request(hdev, LEGION_REPORT_ID, (u8 *)msg, get_size,
+				 HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
+	if (ret < 0)
+		return ret;
+	if (ret < get_size || msg->report_id != LEGION_REPORT_ID ||
+	    msg->op != op) {
+		hid_dbg(hdev, "unexpected answer to 0x%02x\n", op);
+		return -EIO;
+	}
+
+	*answer = msg->params[0];
+	return 0;
+}
+
+static int legion_simple_command(struct legion_kbd *kbd, u8 op, u8 param,
+				 u8 *answer)
+{
+	return legion_raw_command(kbd, op, &param, sizeof(param), answer);
+}
+
+static int legion_brightness_set(struct led_classdev *led,
+				 enum led_brightness value)
+{
+	struct legion_kbd *kbd = container_of(led, struct legion_kbd, led);
+	u8 old = READ_ONCE(kbd->level);
+	int ret;
+
+	if (value > led->max_brightness)
+		return -EINVAL;
+
+	/* Before sending: the report of this set may come before we return. */
+	WRITE_ONCE(kbd->level, value);
+	ret = legion_simple_command(kbd, LEGION_OP_SET_BRIGHTNESS, value, NULL);
+	if (ret)
+		WRITE_ONCE(kbd->level, old);
+
+	return ret;
+}
+
+static enum led_brightness legion_brightness_get(struct led_classdev *led)
+{
+	struct legion_kbd *kbd = container_of(led, struct legion_kbd, led);
+	u8 value;
+	int ret;
+
+	ret = legion_simple_command(kbd, LEGION_OP_GET_BRIGHTNESS, 0, &value);
+	if (ret) {
+		hid_dbg(kbd->hdev, "reading the brightness failed: %d\n", ret);
+		return ret;
+	}
+
+	if (value > led->max_brightness) {
+		hid_dbg(kbd->hdev, "brightness out of range: %u\n", value);
+		return -EIO;
+	}
+
+	WRITE_ONCE(kbd->level, value);
+	return value;
+}
+
+static int legion_raw_event(struct hid_device *hdev, struct hid_report *report,
+			    u8 *data, int size)
+{
+	const struct legion_event *ev = (const struct legion_event *)data;
+	struct legion_kbd *kbd = hid_get_drvdata(hdev);
+
+	if (size < sizeof(*ev) || ev->report_id != LEGION_EVENT_REPORT_ID)
+		return 0;
+
+	if (ev->event != LEGION_EVENT_BRIGHTNESS &&
+	    ev->event != LEGION_EVENT_BRIGHTNESS_DOWN)
+		return 0;
+
+	if (ev->level > kbd->led.max_brightness) {
+		hid_dbg(hdev, "brightness event out of range: %u\n", ev->level);
+		return 0;
+	}
+
+	/*
+	 * Only a change of the level is the hardware's own: the host's sets
+	 * and Fn+Space are reported too, with the level already known.
+	 */
+	if (ev->level == READ_ONCE(kbd->level))
+		return 0;
+	WRITE_ONCE(kbd->level, ev->level);
+
+	/*
+	 * hid-core calls this only after probe() has returned and not once
+	 * remove() has started, so the LED is registered.
+	 */
+	led_classdev_notify_brightness_hw_changed(&kbd->led, ev->level);
+
+	return 0;	/* let hid-core handle the report as usual */
+}
+
+static void legion_stop(void *data)
+{
+	struct hid_device *hdev = data;
+
+	hid_hw_close(hdev);
+	hid_hw_stop(hdev);
+}
+
+static int legion_probe(struct hid_device *hdev, const struct hid_device_id *id)
+{
+	struct legion_kbd *kbd;
+	int ret;
+
+	/*
+	 * Keep the input devices hid-generic creates for this keyboard (which
+	 * sets the same quirk): without it the keyboard, its consumer keys and
+	 * its radio button would become one input device.
+	 */
+	hdev->quirks |= HID_QUIRK_INPUT_PER_APP;
+
+	ret = hid_parse(hdev);
+	if (ret)
+		return ret;
+
+	kbd = devm_kzalloc_obj(&hdev->dev, *kbd);
+	if (!kbd)
+		return -ENOMEM;
+
+	ret = devm_mutex_init(&hdev->dev, &kbd->lock);
+	if (ret)
+		return ret;
+
+	kbd->hdev = hdev;
+	hid_set_drvdata(hdev, kbd);
+
+	ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
+	if (ret)
+		return ret;
+
+	/* Keep the interrupt endpoint polled so hotkey reports always arrive. */
+	ret = hid_hw_open(hdev);
+	if (ret) {
+		hid_hw_stop(hdev);
+		return ret;
+	}
+
+	ret = devm_add_action_or_reset(&hdev->dev, legion_stop, hdev);
+	if (ret)
+		return ret;
+
+	kbd->led.name = "legion::kbd_backlight";
+	kbd->led.max_brightness = LEGION_MAX_BRIGHTNESS;
+	kbd->led.brightness_set_blocking = legion_brightness_set;
+	kbd->led.brightness_get = legion_brightness_get;
+	kbd->led.flags = LED_RETAIN_AT_SHUTDOWN | LED_BRIGHT_HW_CHANGED;
+
+	return devm_led_classdev_register(&hdev->dev, &kbd->led);
+}
+
+static void legion_remove(struct hid_device *hdev)
+{
+	/*
+	 * Done via devm, the LED first. Without .remove, hid-core would stop
+	 * the device before releasing devm resources: before the LED is gone,
+	 * and twice.
+	 */
+}
+
+static const struct hid_device_id legion_devices[] = {
+	{ HID_USB_DEVICE(USB_VENDOR_ID_ITE, USB_DEVICE_ID_ITE_LENOVO_LEGION_GEN10_KBD) },
+	{ }
+};
+MODULE_DEVICE_TABLE(hid, legion_devices);
+
+static struct hid_driver legion_driver = {
+	.name = "hid-lenovo-legion",
+	.id_table = legion_devices,
+	.probe = legion_probe,
+	.remove = legion_remove,
+	.raw_event = legion_raw_event,
+};
+module_hid_driver(legion_driver);
+
+MODULE_AUTHOR("Ciro Pedrini <ciro.pedrini@gmail.com>");
+MODULE_DESCRIPTION("Keyboard backlight of Lenovo Legion laptops");
+MODULE_LICENSE("GPL");

-- 
2.56.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 0/2] Keyboard backlight for the Lenovo Legion Pro 7 Gen 10
  2026-11-27  1:11 [PATCH v3 0/2] Keyboard backlight for the Lenovo Legion Pro 7 Gen 10 Ciro Pedrini via B4 Relay
  2026-11-27  1:11 ` [PATCH v3 1/2] platform/x86: ideapad-laptop: Ignore keyboard backlight hotkeys Ciro Pedrini via B4 Relay
  2026-11-27  1:11 ` [PATCH v3 2/2] HID: lenovo-legion: Add keyboard backlight driver for Legion Gen 10 Ciro Pedrini via B4 Relay
@ 2026-11-28 12:00 ` Rong Zhang
  2026-11-28 17:46 ` Marco Giunta
  3 siblings, 0 replies; 7+ messages in thread
From: Rong Zhang @ 2026-11-28 12:00 UTC (permalink / raw)
  To: ciro.pedrini, Mark Pearson, Derek J. Clark, Ike Panhc,
	Hans de Goede, Ilpo Järvinen, Jiri Kosina,
	Benjamin Tissoires
  Cc: David Cemin, Werner Sembach, Aaron Erhardt, platform-driver-x86,
	linux-kernel, linux-input

Hi Ciro, David,

On Fri, 2026-11-27 at 01:11 +0000, Ciro Pedrini via B4 Relay wrote:
> Hi,
> 
> This is v3 of the Legion keyboard backlight series. It has the changes
> Ilpo and Rong asked for on v2, and one fix I found while testing them.
> 
> Short background: on my laptop the keyboard backlight never turned on
> under Linux. The keyboard controller (048d:c197) stores a brightness from
> 0 to 9 behind a vendor feature report (0x07), it was 0 from the factory,
> and nothing on Linux could change it. That brightness dims every LED of
> the machine. Fn+Up/Down/Space are handled by the firmware, which sends
> the new level on a vendor input report.
> 
> Patch 1 stops ideapad-laptop from sending KEY_UNKNOWN for those three
> keys. Patch 2 is the driver: the brightness as a kbd_backlight LED, plus
> brightness_hw_changed for the hotkeys so the desktop OSD works.
> 
> The fix: while testing v3 I found that the controller sends the same
> "brightness is now B" report after every brightness set, the host's
> own ones too, and also when the level doesn't change (Fn+Space sends
> it as well). v2 passed all of those to brightness_hw_changed, so the
> host's writes looked like hardware changes. v3 only reports a level
> that differs from the last one the driver knows.
> 
> David: patch 1 adds three KE_IGNORE entries to the ideapad WMI keymap,
> which your "architecture independent home for the Lenovo WMI drivers"
> series moves to wmi-fn-keys.c. Whichever goes first, I'm happy to
> rebase mine on yours; it's the same three lines in the new file.

David, could you integrate PATCH 1 into your series when you resubmit it?
I.e., append a PATCH 4.

I believe this is the easiest way to solve the collision. The hid-lenovo-
legion driver (PATCH 2) does not depend on PATCH 1 per se, so they can be
applied in an arbitrary order.

Thanks,
Rong

> 
> I tested it on my 16IAX10H (83F5, BIOS Q7CN77WW) with 7.3 as a module:
> brightness from sysfs and KDE, the hotkeys and the OSD, Fn+Space,
> suspend/resume, unbind and rebind, and the vendor report on the wire
> while doing that. It's based on pdx86 for-next and builds with W=1.
> 
> About how this was made: I found the protocol with usbmon captures and
> by looking at Lenovo's Windows software. I wrote the code with help from
> Claude Code (Claude Opus 5.5). I went through all of it and tested it
> myself, and each patch has a short note about it below the ---.
> 
> Thanks,
> Ciro
> 
> ---
> Changes in v3:
> - Short reports: send only the request bytes and read only the answer
>   bytes, right after the request; no more 100 ms wait (Rong).
> - The buffer is allocated per exchange. Not on the stack as Rong
>   suggested: usbhid hands it to the USB core for DMA.
> - legion_raw_command() and legion_simple_command(), and the request
>   length checked against the 960-byte report with a static_assert
>   (Rong).
> - Out-of-range values and failed reads return errors instead of being
>   clamped or replaced; dbg messages, no hex dump (Ilpo, Rong).
> - devm for hid_hw_start()/hid_hw_open() and the LED; .remove stays,
>   empty, so hid-core doesn't stop the device twice (Ilpo, Rong).
> - Dropped the (int) casts and the "(2025)"; comments trimmed, the one
>   about HID_QUIRK_INPUT_PER_APP now says why; Kconfig help about what
>   the driver does (Ilpo, Rong).
> - New: only report a level change to brightness_hw_changed (see above).
> - Rebased on current pdx86 for-next; Rong's Acked-by on patch 1.
> - Link to v2: https://lore.kernel.org/r/20261110-legion-lighting-rfc-v2-0-845726afb71c@gmail.com
> 
> Changes in v2:
> - Only the keyboard controller (c197) now, as Rong suggested. No
>   LampArray, no colours, no lighting_mode, just a kbd_backlight LED.
> - Ilpo's comments: struct with __le16 for the request, guard(),
>   devm_mutex_init(), no magic numbers, includes.
> - Removed the "ready" flag, its spinlock and the work item. raw_event
>   can't run during probe/remove, so it notifies the LED directly.
> - Keep led_cdev.brightness in sync with the hotkeys (from the Sashiko
>   review).
> - Moved the note about the AI tool out of the changelogs, below the ---.
> - Link to v1: https://lore.kernel.org/r/20261109-legion-lighting-rfc-v1-0-a87e1db8c5e3@gmail.com
> 
> ---
> Ciro Pedrini (2):
>       platform/x86: ideapad-laptop: Ignore keyboard backlight hotkeys
>       HID: lenovo-legion: Add keyboard backlight driver for Legion Gen 10
> 
>  MAINTAINERS                                  |   1 +
>  drivers/hid/Kconfig                          |  12 ++
>  drivers/hid/Makefile                         |   1 +
>  drivers/hid/hid-ids.h                        |   1 +
>  drivers/hid/hid-lenovo-legion.c              | 293 +++++++++++++++++++++++++++
>  drivers/platform/x86/lenovo/ideapad-laptop.c |   4 +
>  6 files changed, 312 insertions(+)
> ---
> base-commit: 61c0dac952b9308884936d05cce97565a5c89af4
> change-id: 20261109-legion-lighting-rfc-dc32165df52d
> 
> Best regards,

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 2/2] HID: lenovo-legion: Add keyboard backlight driver for Legion Gen 10
  2026-11-27  1:11 ` [PATCH v3 2/2] HID: lenovo-legion: Add keyboard backlight driver for Legion Gen 10 Ciro Pedrini via B4 Relay
@ 2026-11-28 12:01   ` Rong Zhang
  0 siblings, 0 replies; 7+ messages in thread
From: Rong Zhang @ 2026-11-28 12:01 UTC (permalink / raw)
  To: ciro.pedrini, Mark Pearson, Derek J. Clark, Ike Panhc,
	Hans de Goede, Ilpo Järvinen, Jiri Kosina,
	Benjamin Tissoires
  Cc: David Cemin, Werner Sembach, Aaron Erhardt, platform-driver-x86,
	linux-kernel, linux-input

Hi Ciro,

Thanks for working on this. I believe we are on the right way, but I
still have several concerns.

On Fri, 2026-11-27 at 01:11 +0000, Ciro Pedrini via B4 Relay wrote:
> From: Ciro Pedrini <ciro.pedrini@gmail.com>
> 
> The keyboard backlight of the Lenovo Legion Pro 7 16IAX10H (2025) has no
> Linux support: on the test unit nothing ever lit, because the keyboard
> controller's brightness was 0 from the factory and nothing exposes it.
> 
> The ITE 8258 keyboard controller (048d:c197) is the built-in keyboard and
> carries a vendor protocol on feature report 0x07 (up to 960 bytes): a
> request, answered by reading the report back. Its hardware brightness,
> 0..9, is stored in the controller and applies to every LED of the machine
> (keys, front strip, rear vents, lid logo). The firmware handles Fn+Up and
> Fn+Down itself and reports the new level on vendor input report 5; it
> reports every other set there too, the host's and unchanged ones
> included.
> 
> Expose the brightness as a kbd_backlight LED, legion::kbd_backlight, with
> brightness_hw_changed for the hotkeys so that desktops show their OSD.
> Only a change of the level is reported there, so the host's own sets and
> Fn+Space, which come back with the level already known, are not.
> Unregistering keeps the level (LED_RETAIN_AT_SHUTDOWN): switching it off
> would be stored by the controller.
> 
> The colours stay the controller's own effects, which Fn+Space cycles. The
> machine's HID LampArray (048d:c193) is left to hid-generic, or to a
> generic LampArray driver.
> 
> Tested on the 16IAX10H (83F5) with 7.3 as a module: brightness from sysfs
> and KDE, the hotkeys with KDE's OSD, suspend/resume, unbinding and
> rebinding.
> 
> Signed-off-by: Ciro Pedrini <ciro.pedrini@gmail.com>
> ---
> Prepared with Claude Code (Claude Opus 5.5) from measurements on the
> laptop (usbmon captures) and analysis of the vendor's Windows software
> for interoperability; I reviewed and tested it.
> ---
>  MAINTAINERS                     |   1 +
>  drivers/hid/Kconfig             |  12 ++
>  drivers/hid/Makefile            |   1 +
>  drivers/hid/hid-ids.h           |   1 +
>  drivers/hid/hid-lenovo-legion.c | 293 ++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 308 insertions(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index ba7650cb86b0..6c622b50ac9b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -15187,6 +15187,7 @@ F:	Documentation/ABI/testing/sysfs-driver-hid-lenovo-go
>  F:	Documentation/ABI/testing/sysfs-driver-hid-lenovo-go-s
>  F:	drivers/hid/hid-lenovo-go-s.c
>  F:	drivers/hid/hid-lenovo-go.c
> +F:	drivers/hid/hid-lenovo-legion.c
>  F:	drivers/hid/hid-lenovo.c
>  
>  LENOVO YOGA BOOK 9 KEYBOARD DOCK DRIVER
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> index 2481bc01c435..336be96dcd66 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -652,6 +652,18 @@ config HID_LENOVO_GO_S
>  	S. Say M here to compile this driver as a module. The module will be called
>  	hid-lenovo-go-s.
>  
> +config HID_LENOVO_LEGION
> +	tristate "Lenovo Legion laptop keyboard backlight"
> +	depends on USB_HID
> +	depends on LEDS_CLASS
> +	help
> +	Support for the LEDs of some Lenovo Legion laptops since 2025, with
> +	the brightness changes initiated by predefined shortcuts (e.g.,
> +	Fn+Up/Down) reported via brightness_hw_changed.
> +
> +	Say M here to compile this driver as a module. The module will be called
> +	hid-lenovo-legion.
> +
>  config HID_LETSKETCH
>  	tristate "Letsketch WP9620N tablets"
>  	depends on USB_HID
> diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
> index 43a8eb0f389b..713bb1c89861 100644
> --- a/drivers/hid/Makefile
> +++ b/drivers/hid/Makefile
> @@ -78,6 +78,7 @@ obj-$(CONFIG_HID_LCPOWER)	+= hid-lcpower.o
>  obj-$(CONFIG_HID_LENOVO)	+= hid-lenovo.o
>  obj-$(CONFIG_HID_LENOVO_GO)	+= hid-lenovo-go.o
>  obj-$(CONFIG_HID_LENOVO_GO_S)	+= hid-lenovo-go-s.o
> +obj-$(CONFIG_HID_LENOVO_LEGION)	+= hid-lenovo-legion.o
>  obj-$(CONFIG_HID_LETSKETCH)	+= hid-letsketch.o
>  obj-$(CONFIG_HID_LOGITECH)	+= hid-logitech.o
>  obj-$(CONFIG_HID_LOGITECH)	+= hid-lg-g15.o
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index 91319aa6516d..992b9b147e95 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -773,6 +773,7 @@
>  #define USB_DEVICE_ID_ITE_LENOVO_YOGA2  0x8350
>  #define I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720	0x837a
>  #define USB_DEVICE_ID_ITE_LENOVO_YOGA900	0x8396
> +#define USB_DEVICE_ID_ITE_LENOVO_LEGION_GEN10_KBD	0xc197
>  #define I2C_DEVICE_ID_ITE_LENOVO_YOGA_SLIM_7X_KEYBOARD	0x8987
>  #define I2C_DEVICE_ID_ITE_LENOVO_YOGA_SLIM_7X_G11_KEYBOARD	0x83db
>  #define USB_DEVICE_ID_ITE8595		0x8595
> diff --git a/drivers/hid/hid-lenovo-legion.c b/drivers/hid/hid-lenovo-legion.c
> new file mode 100644
> index 000000000000..cfd42c52500f
> --- /dev/null
> +++ b/drivers/hid/hid-lenovo-legion.c
> @@ -0,0 +1,293 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * HID driver for the keyboard backlight of Lenovo Legion laptops.
> + *
> + * The ITE 8258 keyboard controller (048d:c197) is the built-in keyboard and
> + * carries Lenovo's vendor lighting protocol on feature report 0x07 (up to
> + * 960 bytes): a request (struct legion_msg), answered by reading the report
> + * back with a GET_FEATURE. Requests and answers may be shorter than the
> + * report; the answer is ready as soon as the request has been sent.
> + *
> + * The backlight brightness is op 0xCE (set) / 0xCD (get), 0..9, stored in the
> + * controller; it applies to every LED of the machine (keys, front strip, rear
> + * vents, lid logo). The firmware handles Fn+Up / Fn+Down itself and reports
> + * the new level on vendor input report 5 (struct legion_event). It reports
> + * every other set the same way, also the host's and unchanged levels.
> + *
> + * The colours are the controller's own effects. The LEDs can also be handed
> + * to the HID LampArray of the "Lenovo Lighting" device (048d:c193), which
> + * this driver leaves to others.
> + */
> +
> +#include <linux/build_bug.h>
> +#include <linux/cleanup.h>
> +#include <linux/container_of.h>
> +#include <linux/device.h>
> +#include <linux/hid.h>
> +#include <linux/leds.h>
> +#include <linux/minmax.h>
> +#include <linux/module.h>
> +#include <linux/mutex.h>
> +#include <linux/overflow.h>
> +#include <linux/slab.h>
> +#include <linux/string.h>
> +#include <linux/types.h>
> +
> +#include <asm/byteorder.h>
> +#include <asm/rwonce.h>
> +
> +#include "hid-ids.h"
> +
> +#define LEGION_REPORT_ID		0x07
> +
> +#define LEGION_OP_GET_BRIGHTNESS	0xcd
> +#define LEGION_OP_SET_BRIGHTNESS	0xce
> +#define LEGION_MAX_BRIGHTNESS		9
> +
> +#define LEGION_EVENT_REPORT_ID		0x05
> +#define LEGION_EVENT_BRIGHTNESS		0x02	/* set by the host, Fn+Up, Fn+Space */
> +#define LEGION_EVENT_BRIGHTNESS_DOWN	0x03	/* Fn+Down */
> +
> +/* Request, and its answer: the value is params[0]. */
> +struct legion_msg {
> +	u8 report_id;
> +	u8 op;
> +	__le16 len;			/* of params */
> +	u8 params[];
> +} __packed;
> +
> +#define LEGION_REPORT_PARAM_SIZE	956
> +#define LEGION_REPORT_SIZE		960
> +static_assert(struct_size_t(struct legion_msg, params, LEGION_REPORT_PARAM_SIZE) ==
> +	      LEGION_REPORT_SIZE);
> +
> +struct legion_event {
> +	u8 report_id;
> +	u8 event;
> +	u8 level;			/* brightness after the change */
> +} __packed;
> +
> +struct legion_kbd {
> +	struct hid_device *hdev;
> +	struct mutex lock;		/* one request/answer exchange at a time */
> +	struct led_classdev led;
> +	u8 level;			/* last level set, read or reported */
> +};
> +
> +/*
> + * Send one request. When @answer is non-NULL, read the controller's answer
> + * and return its value there.
> + */
> +static int legion_raw_command(struct legion_kbd *kbd, u8 op, const u8 *params,
> +			      size_t len, u8 *answer)
> +{
> +	size_t get_size = struct_size_t(struct legion_msg, params, 1);
> +	size_t set_size = struct_size_t(struct legion_msg, params, len);
> +	struct hid_device *hdev = kbd->hdev;
> +	int ret;
> +
> +	if (len > LEGION_REPORT_PARAM_SIZE)
> +		return -EINVAL;
> +
> +	/* Not on the stack: usbhid passes the buffer to the USB core for DMA. */

Whoops, missed that.

> +	struct legion_msg *msg __free(kfree) =
> +		kzalloc_flex(*msg, params, max(len, 1));
> +	if (!msg)
> +		return -ENOMEM;
> +
> +	msg->report_id = LEGION_REPORT_ID;
> +	msg->op = op;
> +	msg->len = cpu_to_le16(len);
> +	memcpy(msg->params, params, len);
> +
> +	guard(mutex)(&kbd->lock);

Since you need to serialize SET_REPORT and GET_REPORT anyway, we can use
a preallocated buffer as v2 did. Sorry for the confusion.

> +
> +	ret = hid_hw_raw_request(hdev, LEGION_REPORT_ID, (u8 *)msg, set_size,
> +				 HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
> +	if (ret < 0)
> +		return ret;
> +	if (!answer)
> +		return 0;
> +
> +	memset(msg, 0, get_size);

I am not sure why this is required.

> +	ret = hid_hw_raw_request(hdev, LEGION_REPORT_ID, (u8 *)msg, get_size,
> +				 HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
> +	if (ret < 0)
> +		return ret;
> +	if (ret < get_size || msg->report_id != LEGION_REPORT_ID ||
> +	    msg->op != op) {
> +		hid_dbg(hdev, "unexpected answer to 0x%02x\n", op);
> +		return -EIO;
> +	}
> +
> +	*answer = msg->params[0];
> +	return 0;
> +}
> +
> +static int legion_simple_command(struct legion_kbd *kbd, u8 op, u8 param,
> +				 u8 *answer)
> +{
> +	return legion_raw_command(kbd, op, &param, sizeof(param), answer);
> +}
> +
> +static int legion_brightness_set(struct led_classdev *led,
> +				 enum led_brightness value)
> +{
> +	struct legion_kbd *kbd = container_of(led, struct legion_kbd, led);
> +	u8 old = READ_ONCE(kbd->level);
> +	int ret;
> +
> +	if (value > led->max_brightness)
> +		return -EINVAL;
> +
> +	/* Before sending: the report of this set may come before we return. */
> +	WRITE_ONCE(kbd->level, value);
> +	ret = legion_simple_command(kbd, LEGION_OP_SET_BRIGHTNESS, value, NULL);
> +	if (ret)
> +		WRITE_ONCE(kbd->level, old);

This is very fragile. Could you serialize legion_brightness_{set,get}()
and legion_raw_event() with kbd->lock, rather than deferring the
serialization to legion_raw_command()? Note that in this manner you'll
need to add a lockdep assertion to the latter.

Thanks,
Rong

> +
> +	return ret;
> +}
> +
> +static enum led_brightness legion_brightness_get(struct led_classdev *led)
> +{
> +	struct legion_kbd *kbd = container_of(led, struct legion_kbd, led);
> +	u8 value;
> +	int ret;
> +
> +	ret = legion_simple_command(kbd, LEGION_OP_GET_BRIGHTNESS, 0, &value);
> +	if (ret) {
> +		hid_dbg(kbd->hdev, "reading the brightness failed: %d\n", ret);
> +		return ret;
> +	}
> +
> +	if (value > led->max_brightness) {
> +		hid_dbg(kbd->hdev, "brightness out of range: %u\n", value);
> +		return -EIO;
> +	}
> +
> +	WRITE_ONCE(kbd->level, value);
> +	return value;
> +}
> +
> +static int legion_raw_event(struct hid_device *hdev, struct hid_report *report,
> +			    u8 *data, int size)
> +{
> +	const struct legion_event *ev = (const struct legion_event *)data;
> +	struct legion_kbd *kbd = hid_get_drvdata(hdev);
> +
> +	if (size < sizeof(*ev) || ev->report_id != LEGION_EVENT_REPORT_ID)
> +		return 0;
> +
> +	if (ev->event != LEGION_EVENT_BRIGHTNESS &&
> +	    ev->event != LEGION_EVENT_BRIGHTNESS_DOWN)
> +		return 0;
> +
> +	if (ev->level > kbd->led.max_brightness) {
> +		hid_dbg(hdev, "brightness event out of range: %u\n", ev->level);
> +		return 0;
> +	}
> +
> +	/*
> +	 * Only a change of the level is the hardware's own: the host's sets
> +	 * and Fn+Space are reported too, with the level already known.
> +	 */
> +	if (ev->level == READ_ONCE(kbd->level))
> +		return 0;
> +	WRITE_ONCE(kbd->level, ev->level);
> +
> +	/*
> +	 * hid-core calls this only after probe() has returned and not once
> +	 * remove() has started, so the LED is registered.
> +	 */
> +	led_classdev_notify_brightness_hw_changed(&kbd->led, ev->level);
> +
> +	return 0;	/* let hid-core handle the report as usual */
> +}
> +
> +static void legion_stop(void *data)
> +{
> +	struct hid_device *hdev = data;
> +
> +	hid_hw_close(hdev);
> +	hid_hw_stop(hdev);
> +}
> +
> +static int legion_probe(struct hid_device *hdev, const struct hid_device_id *id)
> +{
> +	struct legion_kbd *kbd;
> +	int ret;
> +
> +	/*
> +	 * Keep the input devices hid-generic creates for this keyboard (which
> +	 * sets the same quirk): without it the keyboard, its consumer keys and
> +	 * its radio button would become one input device.
> +	 */
> +	hdev->quirks |= HID_QUIRK_INPUT_PER_APP;
> +
> +	ret = hid_parse(hdev);
> +	if (ret)
> +		return ret;
> +
> +	kbd = devm_kzalloc_obj(&hdev->dev, *kbd);
> +	if (!kbd)
> +		return -ENOMEM;
> +
> +	ret = devm_mutex_init(&hdev->dev, &kbd->lock);
> +	if (ret)
> +		return ret;
> +
> +	kbd->hdev = hdev;
> +	hid_set_drvdata(hdev, kbd);
> +
> +	ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
> +	if (ret)
> +		return ret;
> +
> +	/* Keep the interrupt endpoint polled so hotkey reports always arrive. */
> +	ret = hid_hw_open(hdev);
> +	if (ret) {
> +		hid_hw_stop(hdev);
> +		return ret;
> +	}
> +
> +	ret = devm_add_action_or_reset(&hdev->dev, legion_stop, hdev);
> +	if (ret)
> +		return ret;
> +
> +	kbd->led.name = "legion::kbd_backlight";
> +	kbd->led.max_brightness = LEGION_MAX_BRIGHTNESS;
> +	kbd->led.brightness_set_blocking = legion_brightness_set;
> +	kbd->led.brightness_get = legion_brightness_get;
> +	kbd->led.flags = LED_RETAIN_AT_SHUTDOWN | LED_BRIGHT_HW_CHANGED;
> +
> +	return devm_led_classdev_register(&hdev->dev, &kbd->led);
> +}
> +
> +static void legion_remove(struct hid_device *hdev)
> +{
> +	/*
> +	 * Done via devm, the LED first. Without .remove, hid-core would stop
> +	 * the device before releasing devm resources: before the LED is gone,
> +	 * and twice.
> +	 */
> +}
> +
> +static const struct hid_device_id legion_devices[] = {
> +	{ HID_USB_DEVICE(USB_VENDOR_ID_ITE, USB_DEVICE_ID_ITE_LENOVO_LEGION_GEN10_KBD) },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(hid, legion_devices);
> +
> +static struct hid_driver legion_driver = {
> +	.name = "hid-lenovo-legion",
> +	.id_table = legion_devices,
> +	.probe = legion_probe,
> +	.remove = legion_remove,
> +	.raw_event = legion_raw_event,
> +};
> +module_hid_driver(legion_driver);
> +
> +MODULE_AUTHOR("Ciro Pedrini <ciro.pedrini@gmail.com>");
> +MODULE_DESCRIPTION("Keyboard backlight of Lenovo Legion laptops");
> +MODULE_LICENSE("GPL");

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 0/2] Keyboard backlight for the Lenovo Legion Pro 7 Gen 10
  2026-11-27  1:11 [PATCH v3 0/2] Keyboard backlight for the Lenovo Legion Pro 7 Gen 10 Ciro Pedrini via B4 Relay
                   ` (2 preceding siblings ...)
  2026-11-28 12:00 ` [PATCH v3 0/2] Keyboard backlight for the Lenovo Legion Pro 7 " Rong Zhang
@ 2026-11-28 17:46 ` Marco Giunta
  2026-11-28 18:43   ` Rong Zhang
  3 siblings, 1 reply; 7+ messages in thread
From: Marco Giunta @ 2026-11-28 17:46 UTC (permalink / raw)
  To: devnull+ciro.pedrini.gmail.com
  Cc: aer, bentiss, ciro.pedrini, dcemin, derekjohn.clark, hansg, i,
	ikepanhc, ilpo.jarvinen, jikos, linux-input, linux-kernel,
	mpearson-lenovo, platform-driver-x86, wse, marco_giunta

Hi all,

Ciro, thank you for this series. Some time ago I started working on
the exact same driver, but never really had the time to polish it and
submit it. Now that you did, I can happily and lazily skip this effort.

I have some high-level comments on the series. For reference, my laptop is
the Legion Pro 7 16AFR10H, which is the AMD variant of the 16IAX10H.

Apologies for not sending this earlier, I missed v1 and v2.
I see that in v3 you already fixed e.g. ignoring the spurious "brightness
up" event reported after OS/fn+up/fn+space-induced state changes or
removing the unnecessary sleep, but there are still some missing things.

1. More WMI event codes to be ignored
--------------------------------------------------------------------------
(This part is for both Ciro and David, since Rong suggested moving patch 1
into David's series.)

On my laptop, the WMI codes emitted when pressing fn+space or fn+up/down
encode the new state, not just "state changed": there are 6 codes for the
RGB presets and 4 for the brightness levels. Here is the code I had
written in my draft series:

	/*
	 * Legion keyboard backlight level, Fn+Up/Down (handled by the firmware,
	 * changes reported by hid-lenovo-legion)
	 */
	{ KE_IGNORE,	0x18 | IDEAPAD_WMI_KEY },	/* off */
	{ KE_IGNORE,	0x19 | IDEAPAD_WMI_KEY },	/* low */
	{ KE_IGNORE,	0x1a | IDEAPAD_WMI_KEY },	/* medium */
	{ KE_IGNORE,	0x26 | IDEAPAD_WMI_KEY },	/* high */
	/* Legion keyboard lighting preset, Fn+Space (handled by the firmware) */
	{ KE_IGNORE,	0x20 | IDEAPAD_WMI_KEY },	/* preset 1 */
	{ KE_IGNORE,	0x21 | IDEAPAD_WMI_KEY },	/* preset 2 */
	{ KE_IGNORE,	0x22 | IDEAPAD_WMI_KEY },	/* preset 3 */
	{ KE_IGNORE,	0x23 | IDEAPAD_WMI_KEY },	/* preset 4 */
	{ KE_IGNORE,	0x24 | IDEAPAD_WMI_KEY },	/* preset 5 */
	{ KE_IGNORE,	0x25 | IDEAPAD_WMI_KEY },	/* preset 6 */

Ciro:
The three codes in your patch 1 (0x21 for fn+space, 0x1a for fn+up, 0x19
for fn+down) are exactly my "preset 2", "medium" and "low". Of course the
Intel and AMD models' firmwares may simply differ here, but it could also
be that your laptop behaves like mine and each key press you tested
happened to land on those states.
Could you check by cycling through *all* brightness levels and presets
with evtest? If so, the other seven codes still reach userspace as
KEY_UNKNOWN on your machine as well with the current patch 1.

My guess is that the two laptops behave identically, since it would be
unusual for these WMI codes not to be Lenovo-wide constants, especially on
two closely related models, but this is just a guess on my end. Maybe
Rong or Mark have some insight on this.

Regardless of the exact meaning on any particular model, the firmware
handles these keys and the HID driver reports the brightness changes, so
none of these WMI events are needed and all ten should be KE_IGNORE'd.
This is the only relevant (and actionable) point I'm trying to make in
this section.

Whichever version of patch 1 carries all ten codes, in this series or in
David's, will get my Reviewed-by tag.

2. 0xd1 compatibility check on other Legion models
--------------------------------------------------------------------------
On my Legion, and I would assume yours as well, the KBLC ACPI method is
present in firmware but it's a stub: trying to do anything with it fails,
and ideapad-laptop says:

ideapad_acpi VPC2004:00: Unknown keyboard type: 1

without registering any platform::kbd_backlight LED cdev.

This makes sense, given that the backlight is actually driven by the USB
keyboard controller. However, the opposite happens on the Legion Y9000P
IAX10, which is the China-exclusive version of the 16IAX10H and has the
same keyboard controller with the same USB ID. A tester of mine kindly ran
some tests on that laptop; here's the summary:

* The IAX10 only has a white backlight, similarly to most Yogas.
* Consistently with the above, that device uses the KBLC method: the
  platform::kbd_backlight LED is already registered and functional
  (tested with upower on an unpatched kernel). Regarding the hardware,
  the keyboard's brightness is changed with the Yoga-like fn+space combo,
  while fn+up/down does nothing.
* On the HID side, GET_BRIGHTNESS always returns 9 regardless of the
  actual level, and the controller sends no report 5 on fn+space or on
  brightness changes through platform::kbd_backlight.

Also note that your 16IAX10H and the tester's Y9000P report the same BIOS
version, Q7CN77WW (on top of the same 83F5 DMI), so neither the USB ID nor
DMI/BIOS matching can tell these machines apart. For reference, Lenovo's
BIOS changelogs, e.g. the latest one:
https://download.lenovo.com/consumer/mobiles/q7cn83ww.txt
officially confirm that the same BIOS image is shared between the Legion
Pro 7 16IAX10H, the Legion Y9000P IAX10H and the Legion Y9000P IAX10.

So if the driver binds based on the USB ID alone, it will register a
second, broken kbd_backlight LED on devices that already have a
functioning one.

Fortunately, there seems to be a programmatic way of telling these cases
apart. This project:
https://github.com/LenovoLegionToolkit-Team/LenovoLegionToolkit/
is a GPLv3 Windows app aiming to replace the proprietary Lenovo apps, and
includes a complete reverse engineering of the keyboard's HID protocol.

Here is a userspace Linux/Python port of the above targeting exclusively
the RGB functionality:
https://github.com/alstergee/legion-spectrum-control/

One opcode reported in these repos that your driver doesn't use is 0xd1,
which is called "compatibility". I have checked that on my 16AFR10H it
returns 0, while on my tester's Y9000P it returns 1, so indeed it seems
like the right tool for the job. Could you confirm that it returns 0
on your 16IAX10H too, before relying on it?

Overall, my suggestion would be to add a small helper, something like
legion_is_compatible(), that returns whether the response to 0xd1 is zero;
alternatively, something like legion_check_compatibility() that returns
-ENODEV on failure (I personally prefer the simpler version, but I'll
leave such details to Rong and Ilpo). Either way, I suggest using this
helper in probe to conditionally skip the LED registration on incompatible
models, while still keeping the keyboard itself working.

3. Legion Pro 5 Gen 10 models with ID 0xc195
--------------------------------------------------------------------------
This part isn't directed at anyone in this thread specifically.
In some open issues in the second GitHub repo I linked, people report
trying these HID commands in userspace on Legion Pro 5 Gen 10 models (also
from 2025), whose keyboard controllers have ID 0xc195 instead of 0xc197.
Brightness and whole-keyboard colour reportedly work, while per-key
colours light up the wrong keys (which doesn't matter for this driver,
since it only handles the brightness for now).

So, if any owner of a Pro 5 Gen 10 model is reading this, please consider
testing the driver on your device with 0xc195 added to the legion_devices
table. (I wouldn't recommend adding the ID to the patch without direct
confirmation.)

4. Some notes on patch 2
--------------------------------------------------------------------------
I haven't had time to review the code in detail, but a few things stood
out while skimming through this thread and the past ones:

* I gave v3 a quick try on my 16AFR10H (on 7.3.6 + Fedora 45 KDE, with
  devm_kzalloc_obj() replaced by devm_kzalloc() since the former is only
  available from 7.4). Everything works as expected based on a 5-minute
  test, including the short reports, suspend/resume (the level is kept
  and the hotkeys still update the OSD afterwards) and reboots (the level
  is kept from GRUB onwards, and KDE's slider picks it up).
  Also, exposing the raw 0-9 range turns out to be a good choice: in my
  draft I had limited it to the 0/3/6/9 steps used by fn+up/down, but on
  my laptop the intermediate levels are all visibly different, so KDE's
  slider gives finer control than the hotkeys do. I didn't know the
  keyboard had these "hidden" intermediate levels, so thanks for that.
  BTW, mixing software and hardware controls works as well: starting
  from an intermediate level (i.e. not a multiple of 3), fn+up and
  fn+down snap to the nearest multiple of 3 in that direction (e.g.
  1 + fn+up -> 3, 4 + fn+down -> 3), and KDE's OSD follows on screen.
  So if this were the final revision I'd give my Tested-by, but I'll
  save that for a later one.
* Separately from Rong's question about the function part of the name,
  "legion::kbd_backlight" uses a vendor/product name as the devicename,
  which Documentation/leds/leds-class.rst describes as deprecated;
  ":kbd_backlight" is the documented form, and my suggestion going
  forward.
* About Rong's suggestion to serialize legion_brightness_{set,get}() and
  legion_raw_event() with kbd->lock: if I'm not mistaken, kbd->lock is
  a mutex and raw_event runs in interrupt context, so it can't be taken
  there.
  In my draft I kept a mutex in set/get around the whole SET/GET exchange
  (with a lockdep assertion in the command helper), plus a spinlock
  protecting only the cached level, which set() and raw_event both read
  and write. Unlike your v1 spinlock, which only guarded the redundant
  "ready" flag, this one protects the current brightness state, which is
  shared with raw_event.
  That said, most of my experience is in the sound tree, so I'm not 100%
  sure this is the best (or even a correct) approach, and I'll gladly
  defer to Rong on the details.

5. In conclusion...
--------------------------------------------------------------------------
Ciro, I'm sure Rong, Ilpo and Mark will offer much more useful and timely
commentary on the code than I could, so please don't wait for another mail
from me before sending v4. And when you do, please CC me so I can provide
my Tested-by and Reviewed-by tags ASAP. Again, I'm quite busy at the
moment, so I can't give an in-depth review for now, but I'll gladly do
one later if possible.

Thanks again for working on this.

Best regards,
Marco

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 0/2] Keyboard backlight for the Lenovo Legion Pro 7 Gen 10
  2026-11-28 17:46 ` Marco Giunta
@ 2026-11-28 18:43   ` Rong Zhang
  0 siblings, 0 replies; 7+ messages in thread
From: Rong Zhang @ 2026-11-28 18:43 UTC (permalink / raw)
  To: Marco Giunta, devnull+ciro.pedrini.gmail.com
  Cc: aer, bentiss, ciro.pedrini, dcemin, derekjohn.clark, hansg,
	ikepanhc, ilpo.jarvinen, jikos, linux-input, linux-kernel,
	mpearson-lenovo, platform-driver-x86, wse

Hi Macro,

Thanks for your detailed information.

On Sat, 2026-11-28 at 18:46 +0100, Marco Giunta wrote:
> Hi all,
> 
> Ciro, thank you for this series. Some time ago I started working on
> the exact same driver, but never really had the time to polish it and
> submit it. Now that you did, I can happily and lazily skip this effort.
> 
> I have some high-level comments on the series. For reference, my laptop is
> the Legion Pro 7 16AFR10H, which is the AMD variant of the 16IAX10H.
> 
> Apologies for not sending this earlier, I missed v1 and v2.
> I see that in v3 you already fixed e.g. ignoring the spurious "brightness
> up" event reported after OS/fn+up/fn+space-induced state changes or
> removing the unnecessary sleep, but there are still some missing things.
> 
> 1. More WMI event codes to be ignored
> --------------------------------------------------------------------------
> (This part is for both Ciro and David, since Rong suggested moving patch 1
> into David's series.)
> 
> On my laptop, the WMI codes emitted when pressing fn+space or fn+up/down
> encode the new state, not just "state changed": there are 6 codes for the
> RGB presets and 4 for the brightness levels. Here is the code I had
> written in my draft series:
> 
> 	/*
> 	 * Legion keyboard backlight level, Fn+Up/Down (handled by the firmware,
> 	 * changes reported by hid-lenovo-legion)
> 	 */
> 	{ KE_IGNORE,	0x18 | IDEAPAD_WMI_KEY },	/* off */
> 	{ KE_IGNORE,	0x19 | IDEAPAD_WMI_KEY },	/* low */
> 	{ KE_IGNORE,	0x1a | IDEAPAD_WMI_KEY },	/* medium */
> 	{ KE_IGNORE,	0x26 | IDEAPAD_WMI_KEY },	/* high */
> 	/* Legion keyboard lighting preset, Fn+Space (handled by the firmware) */
> 	{ KE_IGNORE,	0x20 | IDEAPAD_WMI_KEY },	/* preset 1 */
> 	{ KE_IGNORE,	0x21 | IDEAPAD_WMI_KEY },	/* preset 2 */
> 	{ KE_IGNORE,	0x22 | IDEAPAD_WMI_KEY },	/* preset 3 */
> 	{ KE_IGNORE,	0x23 | IDEAPAD_WMI_KEY },	/* preset 4 */
> 	{ KE_IGNORE,	0x24 | IDEAPAD_WMI_KEY },	/* preset 5 */
> 	{ KE_IGNORE,	0x25 | IDEAPAD_WMI_KEY },	/* preset 6 */
> 
> Ciro:
> The three codes in your patch 1 (0x21 for fn+space, 0x1a for fn+up, 0x19
> for fn+down) are exactly my "preset 2", "medium" and "low". Of course the
> Intel and AMD models' firmwares may simply differ here, but it could also
> be that your laptop behaves like mine and each key press you tested
> happened to land on those states.
> Could you check by cycling through *all* brightness levels and presets
> with evtest? If so, the other seven codes still reach userspace as
> KEY_UNKNOWN on your machine as well with the current patch 1.
> 
> My guess is that the two laptops behave identically, since it would be
> unusual for these WMI codes not to be Lenovo-wide constants, especially on
> two closely related models, but this is just a guess on my end. Maybe
> Rong or Mark have some insight on this.
> 
> Regardless of the exact meaning on any particular model, the firmware
> handles these keys and the HID driver reports the brightness changes, so
> none of these WMI events are needed and all ten should be KE_IGNORE'd.
> This is the only relevant (and actionable) point I'm trying to make in
> this section.
> 
> Whichever version of patch 1 carries all ten codes, in this series or in
> David's, will get my Reviewed-by tag.
> 
> 2. 0xd1 compatibility check on other Legion models
> --------------------------------------------------------------------------
> On my Legion, and I would assume yours as well, the KBLC ACPI method is
> present in firmware but it's a stub: trying to do anything with it fails,
> and ideapad-laptop says:
> 
> ideapad_acpi VPC2004:00: Unknown keyboard type: 1
> 
> without registering any platform::kbd_backlight LED cdev.
> 
> This makes sense, given that the backlight is actually driven by the USB
> keyboard controller. However, the opposite happens on the Legion Y9000P
> IAX10, which is the China-exclusive version of the 16IAX10H and has the
> same keyboard controller with the same USB ID. A tester of mine kindly ran
> some tests on that laptop; here's the summary:
> 
> * The IAX10 only has a white backlight, similarly to most Yogas.
> * Consistently with the above, that device uses the KBLC method: the
>   platform::kbd_backlight LED is already registered and functional
>   (tested with upower on an unpatched kernel). Regarding the hardware,
>   the keyboard's brightness is changed with the Yoga-like fn+space combo,
>   while fn+up/down does nothing.
> * On the HID side, GET_BRIGHTNESS always returns 9 regardless of the
>   actual level, and the controller sends no report 5 on fn+space or on
>   brightness changes through platform::kbd_backlight.
> 
> Also note that your 16IAX10H and the tester's Y9000P report the same BIOS
> version, Q7CN77WW (on top of the same 83F5 DMI), so neither the USB ID nor
> DMI/BIOS matching can tell these machines apart. For reference, Lenovo's
> BIOS changelogs, e.g. the latest one:
> https://download.lenovo.com/consumer/mobiles/q7cn83ww.txt
> officially confirm that the same BIOS image is shared between the Legion
> Pro 7 16IAX10H, the Legion Y9000P IAX10H and the Legion Y9000P IAX10.
> 
> So if the driver binds based on the USB ID alone, it will register a
> second, broken kbd_backlight LED on devices that already have a
> functioning one.
> 
> Fortunately, there seems to be a programmatic way of telling these cases
> apart. This project:
> https://github.com/LenovoLegionToolkit-Team/LenovoLegionToolkit/
> is a GPLv3 Windows app aiming to replace the proprietary Lenovo apps, and
> includes a complete reverse engineering of the keyboard's HID protocol.
> 
> Here is a userspace Linux/Python port of the above targeting exclusively
> the RGB functionality:
> https://github.com/alstergee/legion-spectrum-control/
> 
> One opcode reported in these repos that your driver doesn't use is 0xd1,
> which is called "compatibility". I have checked that on my 16AFR10H it
> returns 0, while on my tester's Y9000P it returns 1, so indeed it seems
> like the right tool for the job. Could you confirm that it returns 0
> on your 16IAX10H too, before relying on it?
> 
> Overall, my suggestion would be to add a small helper, something like
> legion_is_compatible(), that returns whether the response to 0xd1 is zero;
> alternatively, something like legion_check_compatibility() that returns
> -ENODEV on failure (I personally prefer the simpler version, but I'll
> leave such details to Rong and Ilpo). 

ACK.

> Either way, I suggest using this
> helper in probe to conditionally skip the LED registration on incompatible
> models, while still keeping the keyboard itself working.
> 
> 3. Legion Pro 5 Gen 10 models with ID 0xc195
> --------------------------------------------------------------------------
> This part isn't directed at anyone in this thread specifically.
> In some open issues in the second GitHub repo I linked, people report
> trying these HID commands in userspace on Legion Pro 5 Gen 10 models (also
> from 2025), whose keyboard controllers have ID 0xc195 instead of 0xc197.
> Brightness and whole-keyboard colour reportedly work, while per-key
> colours light up the wrong keys (which doesn't matter for this driver,
> since it only handles the brightness for now).
> 
> So, if any owner of a Pro 5 Gen 10 model is reading this, please consider
> testing the driver on your device with 0xc195 added to the legion_devices
> table. (I wouldn't recommend adding the ID to the patch without direct
> confirmation.)
> 
> 4. Some notes on patch 2
> --------------------------------------------------------------------------
> I haven't had time to review the code in detail, but a few things stood
> out while skimming through this thread and the past ones:
> 
> * I gave v3 a quick try on my 16AFR10H (on 7.3.6 + Fedora 45 KDE, with
>   devm_kzalloc_obj() replaced by devm_kzalloc() since the former is only
>   available from 7.4). Everything works as expected based on a 5-minute
>   test, including the short reports, suspend/resume (the level is kept
>   and the hotkeys still update the OSD afterwards) and reboots (the level
>   is kept from GRUB onwards, and KDE's slider picks it up).
>   Also, exposing the raw 0-9 range turns out to be a good choice: in my
>   draft I had limited it to the 0/3/6/9 steps used by fn+up/down, but on
>   my laptop the intermediate levels are all visibly different, so KDE's
>   slider gives finer control than the hotkeys do. I didn't know the
>   keyboard had these "hidden" intermediate levels, so thanks for that.
>   BTW, mixing software and hardware controls works as well: starting
>   from an intermediate level (i.e. not a multiple of 3), fn+up and
>   fn+down snap to the nearest multiple of 3 in that direction (e.g.
>   1 + fn+up -> 3, 4 + fn+down -> 3), and KDE's OSD follows on screen.
>   So if this were the final revision I'd give my Tested-by, but I'll
>   save that for a later one.
> * Separately from Rong's question about the function part of the name,
>   "legion::kbd_backlight" uses a vendor/product name as the devicename,
>   which Documentation/leds/leds-class.rst describes as deprecated;
>   ":kbd_backlight" is the documented form, and my suggestion going
>   forward.
> * About Rong's suggestion to serialize legion_brightness_{set,get}() and
>   legion_raw_event() with kbd->lock: if I'm not mistaken, kbd->lock is
>   a mutex and raw_event runs in interrupt context, so it can't be taken
>   there.

Indeed. I missed that. legion_raw_event() doesn't need to be serialized.

>   In my draft I kept a mutex in set/get around the whole SET/GET exchange
>   (with a lockdep assertion in the command helper), plus a spinlock
>   protecting only the cached level, which set() and raw_event both read
>   and write. Unlike your v1 spinlock, which only guarded the redundant
>   "ready" flag, this one protects the current brightness state, which is
>   shared with raw_event.

IMO, using the additional spinlock is equivalent to:

   legion_brightness_set()
   {
   	guard(mutex)();
   
   	old = xchg(&cached, new);
   	ret = legion_simple_command();
   	if (ret)
   		cmpxchg(&cached, old, new);
   }
   
   legion_brightness_get()
   {
   	guard(mutex)();
   
   	legion_simple_command();
   
   	/* With the mutex, there is no need to update the cache brightness. */
   }
   
   legion_raw_event()
   {
   	old = xchg(&cached, new);
   	if (old == new)
   		return;
   }

Thanks,
Marco

>   That said, most of my experience is in the sound tree, so I'm not 100%
>   sure this is the best (or even a correct) approach, and I'll gladly
>   defer to Rong on the details.
> 
> 5. In conclusion...
> --------------------------------------------------------------------------
> Ciro, I'm sure Rong, Ilpo and Mark will offer much more useful and timely
> commentary on the code than I could, so please don't wait for another mail
> from me before sending v4. And when you do, please CC me so I can provide
> my Tested-by and Reviewed-by tags ASAP. Again, I'm quite busy at the
> moment, so I can't give an in-depth review for now, but I'll gladly do
> one later if possible.
> 
> Thanks again for working on this.
> 
> Best regards,
> Marco

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-28 18:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-27  1:11 [PATCH v3 0/2] Keyboard backlight for the Lenovo Legion Pro 7 Gen 10 Ciro Pedrini via B4 Relay
2026-11-27  1:11 ` [PATCH v3 1/2] platform/x86: ideapad-laptop: Ignore keyboard backlight hotkeys Ciro Pedrini via B4 Relay
2026-11-27  1:11 ` [PATCH v3 2/2] HID: lenovo-legion: Add keyboard backlight driver for Legion Gen 10 Ciro Pedrini via B4 Relay
2026-11-28 12:01   ` Rong Zhang
2026-11-28 12:00 ` [PATCH v3 0/2] Keyboard backlight for the Lenovo Legion Pro 7 " Rong Zhang
2026-11-28 17:46 ` Marco Giunta
2026-11-28 18:43   ` Rong Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®