* Re: "advanced" LED controllers
[not found] <20150219211424.GN13603@saruman.tx.rr.com>
@ 2015-02-25 8:25 ` Geert Uytterhoeven
2015-02-25 9:06 ` Alexandre Courbot
0 siblings, 1 reply; 10+ messages in thread
From: Geert Uytterhoeven @ 2015-02-25 8:25 UTC (permalink / raw)
To: Felipe Balbi
Cc: Bryan Wu, Richard Purdie, linux-leds@vger.kernel.org,
Linux Kernel Mailing List, Linux OMAP Mailing List,
linux-gpio@vger.kernel.org
CC linux-gpio, as this looks like the LED equivalent of bulk gpio?
On Thu, Feb 19, 2015 at 10:14 PM, Felipe Balbi <balbi@ti.com> wrote:
> Do we have support for LED controllers which can handle patterns of
> different kinds ? I mean, currently, if we have an LED controller such
> as TPIC2810 [1] which can control 8 different leds and each LED
> corresponds to one bit on register 0x44, we could control leds by just
> "playing" a wave file on the controller and create easy patterns with
> that.
>
> AFAICT, in linux today we would have to register each of the 8 LEDs as a
> different LED and have driver magic to write the proper bits on register
> 0x44, that seems a bit overkill, specially when we want to make
> patterns: instead of writing 0xff we would have to write 0x80, 0x40,
> 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 separately and have the driver cache
> the previous results so we don't end up switching off other LEDs.
>
> IOW, what could be handled with a single write, currently needs 8.
>
> I wonder if there's any work happening to support these slightly more
> inteligent LED engines.
>
> regards
>
> [1] http://www.ti.com/product/tpic2810
>
> ps: tpic2810 is probably the simplest example, lp551, lp5523 and others
> have even more advanced pattern engines which can even handle RGB leds.
>
> Currently the driver loads patterns as if it was a firmware blob and
> registers each of R, G and B components as separate LEDs. Each component
> also has its own brightness controls (something tpic2810 doesn't have,
> it's either on or off).
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: "advanced" LED controllers
2015-02-25 8:25 ` "advanced" LED controllers Geert Uytterhoeven
@ 2015-02-25 9:06 ` Alexandre Courbot
2015-03-02 9:21 ` Pavel Machek
0 siblings, 1 reply; 10+ messages in thread
From: Alexandre Courbot @ 2015-02-25 9:06 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Felipe Balbi, Bryan Wu, Richard Purdie,
linux-leds@vger.kernel.org, Linux Kernel Mailing List,
Linux OMAP Mailing List, linux-gpio@vger.kernel.org
On Wed, Feb 25, 2015 at 5:25 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> CC linux-gpio, as this looks like the LED equivalent of bulk gpio?
Indeed. The LED core could implement something similar to
gpiod_set_array() to allow several LEDs to be set in one call. If the
controller supports it, it would then set all the LEDs at once,
otherwise the core would apply the values serially.
In leds-gpio.c, this multiple LED setting could be implemented by a
single call to gpiod_set_array() and the right thing would happen.
>
> On Thu, Feb 19, 2015 at 10:14 PM, Felipe Balbi <balbi@ti.com> wrote:
>> Do we have support for LED controllers which can handle patterns of
>> different kinds ? I mean, currently, if we have an LED controller such
>> as TPIC2810 [1] which can control 8 different leds and each LED
>> corresponds to one bit on register 0x44, we could control leds by just
>> "playing" a wave file on the controller and create easy patterns with
>> that.
>>
>> AFAICT, in linux today we would have to register each of the 8 LEDs as a
>> different LED and have driver magic to write the proper bits on register
>> 0x44, that seems a bit overkill, specially when we want to make
>> patterns: instead of writing 0xff we would have to write 0x80, 0x40,
>> 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 separately and have the driver cache
>> the previous results so we don't end up switching off other LEDs.
>>
>> IOW, what could be handled with a single write, currently needs 8.
>>
>> I wonder if there's any work happening to support these slightly more
>> inteligent LED engines.
>>
>> regards
>>
>> [1] http://www.ti.com/product/tpic2810
>>
>> ps: tpic2810 is probably the simplest example, lp551, lp5523 and others
>> have even more advanced pattern engines which can even handle RGB leds.
>>
>> Currently the driver loads patterns as if it was a firmware blob and
>> registers each of R, G and B components as separate LEDs. Each component
>> also has its own brightness controls (something tpic2810 doesn't have,
>> it's either on or off).
> --
> To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: "advanced" LED controllers
2015-02-25 9:06 ` Alexandre Courbot
@ 2015-03-02 9:21 ` Pavel Machek
2015-03-03 8:15 ` Alexandre Courbot
0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2015-03-02 9:21 UTC (permalink / raw)
To: Alexandre Courbot
Cc: Geert Uytterhoeven, Felipe Balbi, Bryan Wu, Richard Purdie,
linux-leds@vger.kernel.org, Linux Kernel Mailing List,
Linux OMAP Mailing List, linux-gpio@vger.kernel.org
On Wed 2015-02-25 18:06:07, Alexandre Courbot wrote:
> On Wed, Feb 25, 2015 at 5:25 PM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
> > CC linux-gpio, as this looks like the LED equivalent of bulk gpio?
>
> Indeed. The LED core could implement something similar to
> gpiod_set_array() to allow several LEDs to be set in one call. If the
> controller supports it, it would then set all the LEDs at once,
> otherwise the core would apply the values serially.
>
> In leds-gpio.c, this multiple LED setting could be implemented by a
> single call to gpiod_set_array() and the right thing would happen.
Actually, there are two issues: some controlles can set all LEDs at
once, and some can program pwm level smoothly using given program (and
handle multiple leds in the process).
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: "advanced" LED controllers
2015-03-02 9:21 ` Pavel Machek
@ 2015-03-03 8:15 ` Alexandre Courbot
2015-03-08 20:57 ` RGB LED control (was Re: "advanced" LED controllers) Pavel Machek
0 siblings, 1 reply; 10+ messages in thread
From: Alexandre Courbot @ 2015-03-03 8:15 UTC (permalink / raw)
To: Pavel Machek
Cc: Geert Uytterhoeven, Felipe Balbi, Bryan Wu, Richard Purdie,
linux-leds@vger.kernel.org, Linux Kernel Mailing List,
Linux OMAP Mailing List, linux-gpio@vger.kernel.org
On Mon, Mar 2, 2015 at 6:21 PM, Pavel Machek <pavel@ucw.cz> wrote:
> On Wed 2015-02-25 18:06:07, Alexandre Courbot wrote:
>> On Wed, Feb 25, 2015 at 5:25 PM, Geert Uytterhoeven
>> <geert@linux-m68k.org> wrote:
>> > CC linux-gpio, as this looks like the LED equivalent of bulk gpio?
>>
>> Indeed. The LED core could implement something similar to
>> gpiod_set_array() to allow several LEDs to be set in one call. If the
>> controller supports it, it would then set all the LEDs at once,
>> otherwise the core would apply the values serially.
>>
>> In leds-gpio.c, this multiple LED setting could be implemented by a
>> single call to gpiod_set_array() and the right thing would happen.
>
> Actually, there are two issues: some controlles can set all LEDs at
> once, and some can program pwm level smoothly using given program (and
> handle multiple leds in the process).
In any case, that would be handled at the controller level and should
work with a function similar to gpiod_set_array(), wouldn't it?
^ permalink raw reply [flat|nested] 10+ messages in thread
* RGB LED control (was Re: "advanced" LED controllers)
2015-03-03 8:15 ` Alexandre Courbot
@ 2015-03-08 20:57 ` Pavel Machek
2015-03-09 8:08 ` Geert Uytterhoeven
0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2015-03-08 20:57 UTC (permalink / raw)
To: Alexandre Courbot
Cc: Geert Uytterhoeven, Felipe Balbi, Bryan Wu, Richard Purdie,
linux-leds@vger.kernel.org, Linux Kernel Mailing List,
Linux OMAP Mailing List, linux-gpio@vger.kernel.org
Ok, so I played with RGB LED a bit, and we have quite a gap in
documentation: what 50% brightness means is non-trivial and very
important in case we want to do smooth blinking and color transitions.
Signed-off-by: Pavel Machek <pavel@ucw.cz>
diff --git a/Documentation/ABI/testing/sysfs-class-led b/Documentation/ABI/testing/sysfs-class-led
index 3646ec8..649d7a6 100644
--- a/Documentation/ABI/testing/sysfs-class-led
+++ b/Documentation/ABI/testing/sysfs-class-led
@@ -8,6 +8,11 @@ Description:
non-zero brightness settings. The value is between 0 and
/sys/class/leds/<led>/max_brightness.
+ If LED supports continuous brightness settings, 50% brightness
+ should correspond to 50% brightness perceived by human, in a similar
+ manner pixel brightness on monitor does (not 50% PWM).
+
+
What: /sys/class/leds/<led>/max_brightness
Date: March 2006
KernelVersion: 2.6.17
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: RGB LED control (was Re: "advanced" LED controllers)
2015-03-08 20:57 ` RGB LED control (was Re: "advanced" LED controllers) Pavel Machek
@ 2015-03-09 8:08 ` Geert Uytterhoeven
2015-03-09 9:08 ` Pavel Machek
2015-03-09 11:50 ` Måns Rullgård
0 siblings, 2 replies; 10+ messages in thread
From: Geert Uytterhoeven @ 2015-03-09 8:08 UTC (permalink / raw)
To: Pavel Machek
Cc: Alexandre Courbot, Felipe Balbi, Bryan Wu, Richard Purdie,
linux-leds@vger.kernel.org, Linux Kernel Mailing List,
Linux OMAP Mailing List, linux-gpio@vger.kernel.org
Hi Pavel,
On Sun, Mar 8, 2015 at 9:57 PM, Pavel Machek <pavel@ucw.cz> wrote:
> Ok, so I played with RGB LED a bit, and we have quite a gap in
> documentation: what 50% brightness means is non-trivial and very
> important in case we want to do smooth blinking and color transitions.
>
> Signed-off-by: Pavel Machek <pavel@ucw.cz>
>
> diff --git a/Documentation/ABI/testing/sysfs-class-led b/Documentation/ABI/testing/sysfs-class-led
> index 3646ec8..649d7a6 100644
> --- a/Documentation/ABI/testing/sysfs-class-led
> +++ b/Documentation/ABI/testing/sysfs-class-led
> @@ -8,6 +8,11 @@ Description:
> non-zero brightness settings. The value is between 0 and
> /sys/class/leds/<led>/max_brightness.
>
> + If LED supports continuous brightness settings, 50% brightness
> + should correspond to 50% brightness perceived by human, in a similar
> + manner pixel brightness on monitor does (not 50% PWM).
How many drivers do it right? How many don't?
For those that don't, perhaps we handle the conversion between perceived and
pwm in the core, e.g. by adding a new flag to led_classdev.flags to indicate
the need for conversion?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RGB LED control (was Re: "advanced" LED controllers)
2015-03-09 8:08 ` Geert Uytterhoeven
@ 2015-03-09 9:08 ` Pavel Machek
2015-03-09 11:50 ` Måns Rullgård
1 sibling, 0 replies; 10+ messages in thread
From: Pavel Machek @ 2015-03-09 9:08 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Alexandre Courbot, Felipe Balbi, Bryan Wu, Richard Purdie,
linux-leds@vger.kernel.org, Linux Kernel Mailing List,
Linux OMAP Mailing List, linux-gpio@vger.kernel.org
On Mon 2015-03-09 09:08:37, Geert Uytterhoeven wrote:
> Hi Pavel,
>
> On Sun, Mar 8, 2015 at 9:57 PM, Pavel Machek <pavel@ucw.cz> wrote:
> > Ok, so I played with RGB LED a bit, and we have quite a gap in
> > documentation: what 50% brightness means is non-trivial and very
> > important in case we want to do smooth blinking and color transitions.
> >
> > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> >
> > diff --git a/Documentation/ABI/testing/sysfs-class-led b/Documentation/ABI/testing/sysfs-class-led
> > index 3646ec8..649d7a6 100644
> > --- a/Documentation/ABI/testing/sysfs-class-led
> > +++ b/Documentation/ABI/testing/sysfs-class-led
> > @@ -8,6 +8,11 @@ Description:
> > non-zero brightness settings. The value is between 0 and
> > /sys/class/leds/<led>/max_brightness.
> >
> > + If LED supports continuous brightness settings, 50% brightness
> > + should correspond to 50% brightness perceived by human, in a similar
> > + manner pixel brightness on monitor does (not 50% PWM).
>
> How many drivers do it right? How many don't?
Not sure. leds-lp5523.c gets is wrong. Easy test is to attempt to set
"electric indigo" color
(http://en.wikipedia.org/wiki/Indigo#Violet-blue) and see what comes
out.
> For those that don't, perhaps we handle the conversion between perceived and
> pwm in the core, e.g. by adding a new flag to led_classdev.flags to indicate
> the need for conversion?
There is not that many drivers that support smooth power
adjustments. But yes, we can probably conversion in the core for
trivial case.
Unfortunately, we only have 8-bits of precision to work with...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RGB LED control (was Re: "advanced" LED controllers)
2015-03-09 8:08 ` Geert Uytterhoeven
2015-03-09 9:08 ` Pavel Machek
@ 2015-03-09 11:50 ` Måns Rullgård
2015-03-10 8:04 ` Pavel Machek
1 sibling, 1 reply; 10+ messages in thread
From: Måns Rullgård @ 2015-03-09 11:50 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Pavel Machek, Alexandre Courbot, Felipe Balbi, Bryan Wu,
Richard Purdie, linux-leds@vger.kernel.org,
Linux Kernel Mailing List, Linux OMAP Mailing List,
linux-gpio@vger.kernel.org
Geert Uytterhoeven <geert@linux-m68k.org> writes:
> Hi Pavel,
>
> On Sun, Mar 8, 2015 at 9:57 PM, Pavel Machek <pavel@ucw.cz> wrote:
>> Ok, so I played with RGB LED a bit, and we have quite a gap in
>> documentation: what 50% brightness means is non-trivial and very
>> important in case we want to do smooth blinking and color transitions.
>>
>> Signed-off-by: Pavel Machek <pavel@ucw.cz>
>>
>> diff --git a/Documentation/ABI/testing/sysfs-class-led b/Documentation/ABI/testing/sysfs-class-led
>> index 3646ec8..649d7a6 100644
>> --- a/Documentation/ABI/testing/sysfs-class-led
>> +++ b/Documentation/ABI/testing/sysfs-class-led
>> @@ -8,6 +8,11 @@ Description:
>> non-zero brightness settings. The value is between 0 and
>> /sys/class/leds/<led>/max_brightness.
>>
>> + If LED supports continuous brightness settings, 50% brightness
>> + should correspond to 50% brightness perceived by human, in a similar
>> + manner pixel brightness on monitor does (not 50% PWM).
>
> How many drivers do it right? How many don't?
>
> For those that don't, perhaps we handle the conversion between perceived and
> pwm in the core, e.g. by adding a new flag to led_classdev.flags to indicate
> the need for conversion?
Some LED controllers do the right thing in hardware, so any adjustment
done in the core needs to be optional.
--
Måns Rullgård
mans@mansr.com
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: RGB LED control (was Re: "advanced" LED controllers)
2015-03-09 11:50 ` Måns Rullgård
@ 2015-03-10 8:04 ` Pavel Machek
[not found] ` <CAK5ve-K4jyBSVk1CZ8qQrFgevqdbhdsgZ1ZYX2e-t07494oq4A@mail.gmail.com>
0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2015-03-10 8:04 UTC (permalink / raw)
To: Måns Rullgård
Cc: Geert Uytterhoeven, Alexandre Courbot, Felipe Balbi, Bryan Wu,
Richard Purdie, linux-leds@vger.kernel.org,
Linux Kernel Mailing List, Linux OMAP Mailing List,
linux-gpio@vger.kernel.org
On Mon 2015-03-09 11:50:56, Måns Rullgård wrote:
> Geert Uytterhoeven <geert@linux-m68k.org> writes:
>
> > Hi Pavel,
> >
> > On Sun, Mar 8, 2015 at 9:57 PM, Pavel Machek <pavel@ucw.cz> wrote:
> >> Ok, so I played with RGB LED a bit, and we have quite a gap in
> >> documentation: what 50% brightness means is non-trivial and very
> >> important in case we want to do smooth blinking and color transitions.
> >>
> >> Signed-off-by: Pavel Machek <pavel@ucw.cz>
> >>
> >> diff --git a/Documentation/ABI/testing/sysfs-class-led b/Documentation/ABI/testing/sysfs-class-led
> >> index 3646ec8..649d7a6 100644
> >> --- a/Documentation/ABI/testing/sysfs-class-led
> >> +++ b/Documentation/ABI/testing/sysfs-class-led
> >> @@ -8,6 +8,11 @@ Description:
> >> non-zero brightness settings. The value is between 0 and
> >> /sys/class/leds/<led>/max_brightness.
> >>
> >> + If LED supports continuous brightness settings, 50% brightness
> >> + should correspond to 50% brightness perceived by human, in a similar
> >> + manner pixel brightness on monitor does (not 50% PWM).
> >
> > How many drivers do it right? How many don't?
> >
> > For those that don't, perhaps we handle the conversion between perceived and
> > pwm in the core, e.g. by adding a new flag to led_classdev.flags to indicate
> > the need for conversion?
>
> Some LED controllers do the right thing in hardware, so any adjustment
> done in the core needs to be optional.
Do you have example controller that gets it right, btw?
Bryan, can you apply the documentation patch so we can start fixing
the drivers?
Thanks,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Documentation: leds: clarify what 50% brightness means
[not found] ` <CAK5ve-K4jyBSVk1CZ8qQrFgevqdbhdsgZ1ZYX2e-t07494oq4A@mail.gmail.com>
@ 2015-03-11 9:34 ` Pavel Machek
0 siblings, 0 replies; 10+ messages in thread
From: Pavel Machek @ 2015-03-11 9:34 UTC (permalink / raw)
To: Bryan Wu
Cc: Måns Rullgård, Geert Uytterhoeven, Alexandre Courbot,
Felipe Balbi, Bryan Wu, Richard Purdie,
linux-leds@vger.kernel.org, Linux Kernel Mailing List,
Linux OMAP Mailing List, linux-gpio@vger.kernel.org
I played with RGB LED a bit, and we have quite a gap in
documentation: what 50% brightness means is non-trivial and very
important in case we want to do smooth blinking and color
transitions.
Signed-off-by: Pavel Machek <pavel@ucw.cz>
diff --git a/Documentation/ABI/testing/sysfs-class-led b/Documentation/ABI/testing/sysfs-class-led
index 3646ec8..649d7a6 100644
--- a/Documentation/ABI/testing/sysfs-class-led
+++ b/Documentation/ABI/testing/sysfs-class-led
@@ -8,6 +8,11 @@ Description:
non-zero brightness settings. The value is between 0 and
/sys/class/leds/<led>/max_brightness.
+ If LED supports continuous brightness settings, 50% brightness
+ should correspond to 50% brightness perceived by human, in a similar
+ manner pixel brightness on monitor does (not 50% PWM).
+
+
What: /sys/class/leds/<led>/max_brightness
Date: March 2006
KernelVersion: 2.6.17
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-03-11 9:34 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20150219211424.GN13603@saruman.tx.rr.com>
2015-02-25 8:25 ` "advanced" LED controllers Geert Uytterhoeven
2015-02-25 9:06 ` Alexandre Courbot
2015-03-02 9:21 ` Pavel Machek
2015-03-03 8:15 ` Alexandre Courbot
2015-03-08 20:57 ` RGB LED control (was Re: "advanced" LED controllers) Pavel Machek
2015-03-09 8:08 ` Geert Uytterhoeven
2015-03-09 9:08 ` Pavel Machek
2015-03-09 11:50 ` Måns Rullgård
2015-03-10 8:04 ` Pavel Machek
[not found] ` <CAK5ve-K4jyBSVk1CZ8qQrFgevqdbhdsgZ1ZYX2e-t07494oq4A@mail.gmail.com>
2015-03-11 9:34 ` Documentation: leds: clarify what 50% brightness means Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).