mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Maximum values for multi_intensity sysfs attribute
@ 2026-02-14 19:15 Armin Wolf
  2026-03-03 20:11 ` Armin Wolf
  2026-03-04 11:45 ` Pőcze Barnabás
  0 siblings, 2 replies; 6+ messages in thread
From: Armin Wolf @ 2026-02-14 19:15 UTC (permalink / raw)
  To: linux-leds, Werner Sembach; +Cc: LKML

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?

Thanks,
Armin Wolf


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

* Re: Maximum values for multi_intensity sysfs attribute
  2026-02-14 19:15 Maximum values for multi_intensity sysfs attribute Armin Wolf
@ 2026-03-03 20:11 ` Armin Wolf
  2026-03-03 20:35   ` Werner Sembach
  2026-03-04 11:45 ` Pőcze Barnabás
  1 sibling, 1 reply; 6+ messages in thread
From: Armin Wolf @ 2026-03-03 20:11 UTC (permalink / raw)
  To: linux-leds, Werner Sembach; +Cc: LKML, Lee Jones, pavel

Am 14.02.26 um 20:15 schrieb Armin Wolf:

> 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?
>
> Thanks,
> Armin Wolf 

Any ideas on this? My current approach would be to use 5 for the max brightness and clamp intensity
values to 50.

Thanks,
Armin Wolf


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

* Re: Maximum values for multi_intensity sysfs attribute
  2026-03-03 20:11 ` Armin Wolf
@ 2026-03-03 20:35   ` Werner Sembach
  2026-03-03 20:43     ` Werner Sembach
  0 siblings, 1 reply; 6+ messages in thread
From: Werner Sembach @ 2026-03-03 20:35 UTC (permalink / raw)
  To: Armin Wolf, linux-leds; +Cc: LKML, Lee Jones, pavel


Am 03.03.26 um 21:11 schrieb Armin Wolf:
> Am 14.02.26 um 20:15 schrieb Armin Wolf:
>
>> 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?
>>
>> Thanks,
>> Armin Wolf 
>
> Any ideas on this? My current approach would be to use 5 for the max 
> brightness and clamp intensity
> values to 50.
Another idea is to have multi_intensity values 0-255 and then map it to the 
closest color so normal rgb values can be passed
>
> Thanks,
> Armin Wolf
>

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

* Re: Maximum values for multi_intensity sysfs attribute
  2026-03-03 20:35   ` Werner Sembach
@ 2026-03-03 20:43     ` Werner Sembach
  0 siblings, 0 replies; 6+ messages in thread
From: Werner Sembach @ 2026-03-03 20:43 UTC (permalink / raw)
  To: Armin Wolf, linux-leds; +Cc: LKML, Lee Jones, pavel


Am 03.03.26 um 21:35 schrieb Werner Sembach:
>
> Am 03.03.26 um 21:11 schrieb Armin Wolf:
>> Am 14.02.26 um 20:15 schrieb Armin Wolf:
>>
>>> 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?
>>>
>>> Thanks,
>>> Armin Wolf 
>>
>> Any ideas on this? My current approach would be to use 5 for the max 
>> brightness and clamp intensity
>> values to 50.
> Another idea is to have multi_intensity values 0-255 and then map it to the 
> closest color so normal rgb values can be passed
this would also offer a hook point for some scaling: some uniwill devices have a 
noticeable color hue like pinkish or greenish because the leds max brightness is 
not well balanced, in tuxedo-drivers we sometimes apply some adjustments 
regulating 1 or 2 of the colors generally down like 5 or 10%
>>
>> Thanks,
>> Armin Wolf
>>

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

* Re: Maximum values for multi_intensity sysfs attribute
  2026-02-14 19:15 Maximum values for multi_intensity sysfs attribute Armin Wolf
  2026-03-03 20:11 ` Armin Wolf
@ 2026-03-04 11:45 ` Pőcze Barnabás
  2026-03-04 11:58   ` Werner Sembach
  1 sibling, 1 reply; 6+ messages in thread
From: Pőcze Barnabás @ 2026-03-04 11:45 UTC (permalink / raw)
  To: Armin Wolf, linux-leds, Werner Sembach; +Cc: LKML

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
> 
> 



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

* Re: Maximum values for multi_intensity sysfs attribute
  2026-03-04 11:45 ` Pőcze Barnabás
@ 2026-03-04 11:58   ` Werner Sembach
  0 siblings, 0 replies; 6+ messages in thread
From: Werner Sembach @ 2026-03-04 11:58 UTC (permalink / raw)
  To: Pőcze Barnabás, Armin Wolf, linux-leds; +Cc: LKML

Hi Barnabás,

Am 04.03.26 um 12:45 schrieb Pőcze Barnabás:
> 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.

Note that some devices control the brightness levels via EC directly when 
pressing a key combo with no way of disabling that. So the 5 brightness levels 
can't be easily abstracted away.

For best compatibility I would still suggest adapting the brightness levels of 
the firmware (5 levels), it will cause headaches down the road otherwise.

Best regards,

Werner

>
>
> Barnabás Pőcze
>
>> Thanks,
>> Armin Wolf
>>
>>
>

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

end of thread, other threads:[~2026-03-04 11:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-14 19:15 Maximum values for multi_intensity sysfs attribute Armin Wolf
2026-03-03 20:11 ` Armin Wolf
2026-03-03 20:35   ` Werner Sembach
2026-03-03 20:43     ` Werner Sembach
2026-03-04 11:45 ` Pőcze Barnabás
2026-03-04 11:58   ` Werner Sembach

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®