Re: [PATCH v2 leds-next 3/3] leds: turris-omnia: Add support for continuous brightness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/29/19 3:29 AM, Marek Behun wrote:
   (
     The last two control "global brightness" for all LEDs. The
resulting brigthness of LED X channel C is (i dont know if this is
really linear, but suppose it is):
       global_brightness * X_C_brightness * X_enabled

     So for example the resulting brightness of the red channel of WAN
     LED is
       global_brightness * WAN_red_brightness * WAN_enabled

     This "global brightness" can be set via command 7, or by hardware
     when user presses a button (hardware cycles through 8 levels of
     hardcoded values each time the button is pressed).
   )

Jacek, Pavel,

should I, and if, then how, expose to the user this global_brightness?

I thought about merging this with classic led brightness and writing a
->brightness_get method which would query the global brightness and
then multiply it with the ->brightness which was set, but there is no
way for setting brightness this way, because changing brightness of one
LED could change brightnesses of other LEDs...

This "global_brightness" seems to be similar to LEDn_BRIGHTNESS of
TI lp50xx [0] devices that led us to that whole concept of LED multi
color class.

In short words it assumed incorporating underlaying color channels
into single LED multi color device with the following interface
for setting particular color channels:

colors // not limited to these ones, it's just an example
  red
    brightness
    max_brightenss
  green
    brightness
    max_brihgntess
  blue
    brightness
    max_brightness

There were also other files proposed for atomic setting of all these
channels, but I skip them here.

In addition to that we would have main brightness file as it is
in current LED class, and brightness-model file that would allow
to map brightness file to the counterpart of lp50xx LEDn_BRIGHTNESS
registers or your global brightness. It would be also possible
to define different brightness models in Device Tree by mapping
certain configurations of channel brightnesses to a range of
global brightness levels.

Dan Murphy has a fair piece of that implemented already
on his private branch as a proof of concept.

So, depending on the amount of time you have for your disposal,
you could either try to continue that work or ignore that
global brightness for now.

http://www.ti.com/lit/ds/symlink/lp5024.pdf

--
Best regards,
Jacek Anaszewski



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux