Re: [PATCH v9 05/15] leds: multicolor: Introduce a multicolor class definition

From: Jacek Anaszewski
Date: Sat Sep 28 2019 - 14:32:07 EST


On 9/28/19 12:09 PM, Jacek Anaszewski wrote:
> Dan,
[...]
>>>
>>>
>>>> +ÂÂÂÂÂÂÂ brightness_val[i] = brightness *
>>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ priv->intensity / priv->max_intensity;
>
> Now, looking closer at this equation it becomes obvious to me
> why Pavel opted for common max_brightness: in case of
> <color>_intensity == <color>_max_intensity we will get the result
> equal to max_brightness. And this is problematic: think of a case when
> calculated value will be greater than given <color>_max_intensity.
> It will have to be limited the that constraint and will fail to

s/the that/to that/

> produce proper color combination.
>
> As a solution I see limiting max_brightness to the lowest supported
> brightness from the LEDs in the cluster.

A re-thinking that I withdraw this idea since it will not allow to lit
all LEDs to their max brightness values. Probably we will need just
document that only when all LEDs have the same brightness range the
combined brightness will preserve the hue on the whole its span.

--
Best regards,
Jacek Anaszewski