Re: Maximum values for multi_intensity sysfs attribute
From: Pőcze Barnabás
Date: Wed Mar 04 2026 - 06:49:43 EST
Hi
2026. 02. 14. 20:15 keltezéssel, Armin Wolf írta:
> Hello,
>
> i am currently adding support for RGB keyboard backlight control to the uniwill-laptop
> driver, and want to use the multicolor LED class for that. However the hardware interface
> is a bit exotic:
>
> - 5 global brightness levels
> - 50 intensity levels for each R/G/B channel
>
> I am now asking myself how this should be mapped onto the multi_intensity sysfs attribute.
> Should i set max_brightness to 5 and reject intensity values larger that 50? Or should
> i set max_brightness to 50 and interpolate? What is the input range of intensity values?
Is that the same interface implemented by https://github.com/pobrn/hid-ite8291r3
(and https://github.com/pobrn/ite8291r3-ctl)?
In any case it's probably not too different. Unfortunately I don't recall ever finding a
satisfying way to integrate it with the multi-color led things. The best approach I could
find: brightness as [0; 50], while multi_intesity is [0; 255], essentially specifying the
color of each channel (simply clamping, without `led_mc_calc_color_components()`). Note that
the above kernel driver does not implement per-key color setting, so this approach seemed
most sensible.
Barnabás Pőcze
>
> Thanks,
> Armin Wolf
>
>