[PATCH V3] led: Backlight trigger for led subsystem - Kernel

This is a discussion on [PATCH V3] led: Backlight trigger for led subsystem - Kernel ; This patch set adds a new led trigger which emulates the backlight behaviour: the leds are turned off and on each time the display blanks and unblacks. Since backlights are usually implemented with leds this patch set is useful for ...

+ Reply to Thread
Results 1 to 12 of 12

Thread: [PATCH V3] led: Backlight trigger for led subsystem

  1. [PATCH V3] led: Backlight trigger for led subsystem

    This patch set adds a new led trigger which emulates the backlight
    behaviour: the leds are turned off and on each time the display blanks
    and unblacks.

    Since backlights are usually implemented with leds this patch set is
    useful for those drivers whose manage leds controller used as
    backlight controller.

    The driver simply registers itself into the led subsystem and then the
    user may get backlight emulation by setting the "backlight"
    trigger. Moreover a driver, which usually manages more than one led,
    can use some leds as "led" and the others as "backlights" at user
    request.

    Rodolfo

    ---

    CHANGELOG:

    V2 ---> V3:

    * Avoid that two consecutive blank commands as follow:

    echo 1 > /sys/class/graphics/fb0/blank
    echo 1 > /sys/class/graphics/fb0/blank

    may vanish unblank led intensity status.


    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [PATCH V3] led: Backlight trigger for led subsystem

    Hi!

    > This patch set adds a new led trigger which emulates the backlight
    > behaviour: the leds are turned off and on each time the display blanks
    > and unblacks.
    >
    > Since backlights are usually implemented with leds this patch set is
    > useful for those drivers whose manage leds controller used as
    > backlight controller.
    >
    > The driver simply registers itself into the led subsystem and then the
    > user may get backlight emulation by setting the "backlight"
    > trigger. Moreover a driver, which usually manages more than one led,
    > can use some leds as "led" and the others as "backlights" at user
    > request.


    We already have backlight subsystem, it can also handle display
    brightness. Why not use that?


    --
    (english) http://www.livejournal.com/~pavelmachek
    (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pav...rses/blog.html
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. Re: [PATCH V3] led: Backlight trigger for led subsystem

    On Tue, Oct 07, 2008 at 03:54:20PM +0200, Pavel Machek wrote:
    > Hi!
    >
    > > This patch set adds a new led trigger which emulates the backlight
    > > behaviour: the leds are turned off and on each time the display blanks
    > > and unblacks.
    > >
    > > Since backlights are usually implemented with leds this patch set is
    > > useful for those drivers whose manage leds controller used as
    > > backlight controller.
    > >
    > > The driver simply registers itself into the led subsystem and then the
    > > user may get backlight emulation by setting the "backlight"
    > > trigger. Moreover a driver, which usually manages more than one led,
    > > can use some leds as "led" and the others as "backlights" at user
    > > request.

    >
    > We already have backlight subsystem, it can also handle display
    > brightness. Why not use that?


    Just to use a led as "led" or as "backlight" at user request. You can
    do it by using:

    echo none > /sys/class/leds/lcd/trigger
    echo backlight > /sys/class/leds/lcd/trigger

    and the led will work accordingly.

    Also a led used as "backlight" is just a normal led (you can set the
    brightness as a normal led) but it switchs off automatically when the
    LCD blanks.

    Ciao,

    Rodolfo

    --

    GNU/Linux Solutions e-mail: giometti@enneenne.com
    Linux Device Driver giometti@linux.it
    Embedded Systems phone: +39 349 2432127
    UNIX programming skype: rodolfo.giometti
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  4. Re: [PATCH V3] led: Backlight trigger for led subsystem

    On Tue 2008-10-07 17:20:32, Rodolfo Giometti wrote:
    > On Tue, Oct 07, 2008 at 03:54:20PM +0200, Pavel Machek wrote:
    > > Hi!
    > >
    > > > This patch set adds a new led trigger which emulates the backlight
    > > > behaviour: the leds are turned off and on each time the display blanks
    > > > and unblacks.
    > > >
    > > > Since backlights are usually implemented with leds this patch set is
    > > > useful for those drivers whose manage leds controller used as
    > > > backlight controller.
    > > >
    > > > The driver simply registers itself into the led subsystem and then the
    > > > user may get backlight emulation by setting the "backlight"
    > > > trigger. Moreover a driver, which usually manages more than one led,
    > > > can use some leds as "led" and the others as "backlights" at user
    > > > request.

    > >
    > > We already have backlight subsystem, it can also handle display
    > > brightness. Why not use that?

    >
    > Just to use a led as "led" or as "backlight" at user request. You can
    > do it by using:
    >
    > echo none > /sys/class/leds/lcd/trigger
    > echo backlight > /sys/class/leds/lcd/trigger
    >
    > and the led will work accordingly.
    >
    > Also a led used as "backlight" is just a normal led (you can set the
    > brightness as a normal led) but it switchs off automatically when the
    > LCD blanks.


    Ok, what is it good for? So I have backlight, charging led and hdd led
    on my zaurus. Now I can set charging led to indicate backlight... but
    why is it useful?
    Pavel
    --
    (english) http://www.livejournal.com/~pavelmachek
    (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pav...rses/blog.html
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  5. Re: [PATCH V3] led: Backlight trigger for led subsystem

    On Tue, Oct 07, 2008 at 08:58:46PM +0200, Pavel Machek wrote:
    >
    > Ok, what is it good for? So I have backlight, charging led and hdd led
    > on my zaurus. Now I can set charging led to indicate backlight... but
    > why is it useful?


    On my board, for example, I have a led for each "special" buttons and
    others to indicate to the user some "special" conditions of machine
    internals. All these leds should be switched off each time the LCD
    blanks and they should get their old brightness status when the LCD
    unblanks.

    Ciao,

    Rodolfo

    --

    GNU/Linux Solutions e-mail: giometti@enneenne.com
    Linux Device Driver giometti@linux.it
    Embedded Systems phone: +39 349 2432127
    UNIX programming skype: rodolfo.giometti
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  6. Re: [PATCH V3] led: Backlight trigger for led subsystem

    On Tue 2008-10-07 21:21:12, Rodolfo Giometti wrote:
    > On Tue, Oct 07, 2008 at 08:58:46PM +0200, Pavel Machek wrote:
    > >
    > > Ok, what is it good for? So I have backlight, charging led and hdd led
    > > on my zaurus. Now I can set charging led to indicate backlight... but
    > > why is it useful?

    >
    > On my board, for example, I have a led for each "special" buttons and
    > others to indicate to the user some "special" conditions of machine
    > internals. All these leds should be switched off each time the LCD
    > blanks and they should get their old brightness status when the LCD
    > unblanks.


    Hmm, what's "your board"?

    But ok, I guess that makes some sense, additionally it would be useful
    for keyboard backlight...

    In fact, thinkpad light should probably behave like that, too...
    Pavel
    --
    (english) http://www.livejournal.com/~pavelmachek
    (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pav...rses/blog.html
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  7. Re: [PATCH V3] led: Backlight trigger for led subsystem

    On Tue, Oct 07, 2008 at 09:56:48PM +0200, Pavel Machek wrote:

    > On Tue 2008-10-07 21:21:12, Rodolfo Giometti wrote:
    > > On my board, for example, I have a led for each "special" buttons and
    > > others to indicate to the user some "special" conditions of machine
    > > internals. All these leds should be switched off each time the LCD
    > > blanks and they should get their old brightness status when the LCD
    > > unblanks.

    >
    > Hmm, what's "your board"?


    Sorry, I meant "my custom board". It's PXA270 based but it's not
    into Linux main tree.

    > But ok, I guess that makes some sense, additionally it would be useful
    > for keyboard backlight...
    >
    > In fact, thinkpad light should probably behave like that, too...




    Ciao,

    Rodolfo

    --

    GNU/Linux Solutions e-mail: giometti@enneenne.com
    Linux Device Driver giometti@linux.it
    Embedded Systems phone: +39 349 2432127
    UNIX programming skype: rodolfo.giometti
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  8. Re: [PATCH V3] led: Backlight trigger for led subsystem

    On Tue, Oct 07, 2008 at 10:19:54PM +0200, Rodolfo Giometti wrote:
    > On Tue, Oct 07, 2008 at 09:56:48PM +0200, Pavel Machek wrote:


    > > Hmm, what's "your board"?


    > Sorry, I meant "my custom board". It's PXA270 based but it's not
    > into Linux main tree.


    Another example, support for which should be coming shortly, is the LED
    driver provided by the WM8350: this is a PMIC capable of producing outputs
    to drive LEDs, potentially strings of very bright LEDs. This is frequently
    used to illuminate displays but the actual function depends entirely on how
    the system has been wired up.

    The implementation is identical no matter what the LEDs are doing but the
    current out of tree drivers have two drivers for this bit of the hardware,
    one for use in the normal LED case and one for when used as a backlight,
    which is redundnant. With the driver Rodolfo has written this should no
    longer be required and the backlight trigger can be used to share the
    hardware interface code.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  9. Re: [PATCH V3] led: Backlight trigger for led subsystem

    On Tue 2008-10-07 21:39:46, Mark Brown wrote:
    > On Tue, Oct 07, 2008 at 10:19:54PM +0200, Rodolfo Giometti wrote:
    > > On Tue, Oct 07, 2008 at 09:56:48PM +0200, Pavel Machek wrote:

    >
    > > > Hmm, what's "your board"?

    >
    > > Sorry, I meant "my custom board". It's PXA270 based but it's not
    > > into Linux main tree.

    >
    > Another example, support for which should be coming shortly, is the LED
    > driver provided by the WM8350: this is a PMIC capable of producing outputs
    > to drive LEDs, potentially strings of very bright LEDs. This is frequently
    > used to illuminate displays but the actual function depends entirely on how
    > the system has been wired up.
    >
    > The implementation is identical no matter what the LEDs are doing but the
    > current out of tree drivers have two drivers for this bit of the hardware,
    > one for use in the normal LED case and one for when used as a backlight,
    > which is redundnant. With the driver Rodolfo has written this should no
    > longer be required and the backlight trigger can be used to share the
    > hardware interface code.


    Well, Rodolfo's patch will not allow you to set backlight brightness,
    only on/off, right?

    So if your leds are really a backlight, you still should use backlight
    class directly...
    Pavel
    --
    (english) http://www.livejournal.com/~pavelmachek
    (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pav...rses/blog.html
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  10. Re: [PATCH V3] led: Backlight trigger for led subsystem

    On Tue, 07 Oct 2008, Pavel Machek wrote:
    > In fact, thinkpad light should probably behave like that, too...


    It is supposed to, and actually does so in my T43 without any extra help :-)

    But if it doesn't in your ThinkPad, thinkpad-acpi does export a LED
    interface for the ThinkLight and this new tigger will fix it for you right
    away

    --
    "One disk to rule them all, One disk to find them. One disk to bring
    them all and in the darkness grind them. In the Land of Redmond
    where the shadows lie." -- The Silicon Valley Tarot
    Henrique Holschuh
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  11. Re: [PATCH V3] led: Backlight trigger for led subsystem

    On Tue, Oct 07, 2008 at 11:19:17PM +0200, Pavel Machek wrote:

    > Well, Rodolfo's patch will not allow you to set backlight brightness,
    > only on/off, right?


    No, you can set the backlight brightness, but when the LCD blanks it
    is set to zero and it get back to its previous status when the LCD
    unblanks.

    Ciao,

    Rodolfo

    --

    GNU/Linux Solutions e-mail: giometti@enneenne.com
    Linux Device Driver giometti@linux.it
    Embedded Systems phone: +39 349 2432127
    UNIX programming skype: rodolfo.giometti
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  12. Re: [PATCH 1/1] led: add a backlight emulation trigger.

    On Tue, 2008-10-07 at 12:10 +0200, Rodolfo Giometti wrote:
    > This allows LEDs to be controlled as a backlight device: they turn off
    > and on when the display is blanked and unblanked.
    >
    > Signed-off-by: Rodolfo Giometti


    Added to the LEDs tree, thanks.

    Richard

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread