Re: [PATCH v2 2/2] HID: lenovo-legion: Add keyboard backlight driver for Legion Gen 10
From: Ciro Pedrini
Date: Thu Nov 26 2026 - 20:16:34 EST
Hi Rong,
On Thu, 2026-11-12 at 01:36 +0800, Rong Zhang wrote:
> ...though I won't insist if you still prefer kbd_backlight, as long as
> others are not opposed to it.
Thanks. I kept kbd_backlight in v3, mostly so UPower and the desktops
pick it up:
https://lore.kernel.org/r/20261127-legion-lighting-rfc-v3-0-15c55d9f15b7@xxxxxxxxx
> In this case you don't need the pre-allocated buffer, too. Let's allocate
> a tiny buffer on stack.
The pre-allocated buffer is gone, but I allocate it per exchange instead
of putting it on the stack: usbhid passes the buffer to usb_control_msg(),
and the USB core refuses stack buffers for DMA (with VMAP_STACK they
aren't DMA-able). Other HID drivers do the same for hid_hw_raw_request().
The short reports are in v3 as well, without the msleep(). The rest of
your v2 comments are done too (raw_command/simple_command, the
static_assert, errors instead of clamping, devm, comments, Kconfig).
One more thing I found while testing: the controller sends 05 02 B after
every brightness set, the host's own ones too, and also when the level
doesn't change (Fn+Space sends it the same way). v2 passed all of those
to brightness_hw_changed, so v3 only reports a level that differs from
the last one the driver knows.
Thanks,
Ciro