Re: led: hw-trigger, global brightness and multi-colored leds

From: Uwe Kleine-KÃnig
Date: Thu May 03 2018 - 15:00:24 EST


Hello Pavel,

On 05/02/2018 11:21 PM, Pavel Machek wrote:
>> on the Turris Omnia[1] the LEDs are controllable via an i2c device. Each
>> LED can be either in "manual mode" or in a mode I'd call "native mode"
>> which is the default. In this native mode the LED being on or off
>> depends on an input line that is controlled by another hardware. So a
>> LED signals for example activity on the WAN ethernet port without any
>> software intervention, but can be used as a normal LED, too, when in
>> "manual mode" where it can be switched on and off by a register
>> write.
>
> "Native mode" is quite common. We have it for example on Nokia N900
> here (charger has hw option to automatically control the LED).

git grep -i n900 -- drivers/leds doesn't yield any output. Do I miss
anything?

> I believe reasonable solution would be to have "hardware" trigger, and
> have it selected by default. When active, LED would be controlled by
> hardware.

There is no prior art for that available as source code, right?

>> Another feature of the LED device is that there is a global brightness
>> register that influences all LED's brightness (if on) independent of the
>> operating mode.
>
> We can't describe that easily.

Given that I can give an RGB value (i.e. 3x 8 bit) for the LED, I can
change brightness per LED. Have to play around a bit.

>> Further the color of each LED can be set to an RGB triplet.
>
> We normally handle RGB LED as three independend LEDs, like
> notify::red, notify::green, notify::blue. Again, example is Nokia N900
> or Motorola Droid 4.

I cannot find source code for LEDs on the Droid 4 either.

An ugly property here is that the hardware trigger only operates on all
three colors at once. Hmm, will think a bit about the way to go.

Best regards and thanks for your input,
Uwe

Attachment: signature.asc
Description: OpenPGP digital signature