Re: [PATCH RFC 0/2] Keyboard lighting for the Lenovo Legion Pro 7 Gen 10

From: Ciro Pedrini

Date: Tue Nov 10 2026 - 15:39:19 EST


Hi Rong,

On Tue, 2026-11-10 at 22:56 +0800, Rong Zhang wrote:
> Thanks for working on this.

Thanks for looking at it (and for the clear direction, it helped a lot).

[...]

> Let's take it step by step, and submit a driver for 048d:c197 first. As
> far as I understood, the driver should be able to handle "hardware
> brightness (0..9, stored), the controller's own effects (stored
> profiles)," and "Fn+Up/Down/Space" by its own. (Please correct me if I
> misunderstood your words.)

Makes sense. v2 only does c197, and it doesn't depend on any LampArray
work:
https://lore.kernel.org/r/20261110-legion-lighting-rfc-v2-0-845726afb71c@xxxxxxxxx

About your question: yes, the firmware does all of that by itself.
Fn+Up/Down change the brightness (in steps of 3, and it's stored) and
the controller sends the new level on a vendor input report. The driver
only exposes the brightness as kbd_backlight and forwards the hotkey
changes as brightness_hw_changed. Fn+Space switches between the stored
effects (6 states counting off). The controller can also read and set
the active effect, but I left that out of v2.

> I am also working on a independent hid-lamparray implementation that is
> far more generic than Aaron and Werner's series.

Something you may want to know for your driver: on this laptop c193
doesn't show anything on its own. c197 has to hand the LEDs over first,
with its vendor command 0xAA (07 AA 02 00 00 00 gives them to the
LampArray, 07 AA 02 00 01 00 gives them back). The controller remembers
it after power-off, but it only matters while the LampArray is in host
mode. In autonomous mode you see the controller's effects anyway. So a
generic driver on c193 alone would register lamps that do nothing until
c197 is switched.

v2 doesn't touch 0xAA. How would you like to handle it with your
driver? A sysfs attribute on c197, something with your autonomous mode
trigger, the component framework? Once your series is out I'm happy to
write that part and test it here.

> Please use the component framework (not in your next revision, it should
> only add support for 048d:c197).

OK, noted.

Thanks,
Ciro