Re: [PATCH v3] led-class: always implement blinking

From: Andrew Morton
Date: Thu Sep 23 2010 - 18:35:57 EST


On Wed, 22 Sep 2010 15:53:58 +0200
Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:

> Currently, blinking LEDs can be awkward because it is
> not guaranteed that all LEDs implement blinking. The
> trigger that wants it to blink then needs to implement
> its own timer solution.
>
> Rather than require that, add led_blink_set() API that
> triggers can use. This function will attempt to use hw
> blinking, but if that fails implements a timer for it.
> To stop blinking again, brightness_set() also needs to
> be wrapped into API that will stop the software blink.
>
> As a result of this, the timer trigger becomes a very
> trivial one, and hopefully we can finally see triggers
> using blinking as well because it's always easy to use.
>
> Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
> ---
> v2: - update documentation
> - use documented way of turning blinking off
> by setting brightness to 0 rather than by
> setting delays to (0, 0)
> - add API to start blinking, set brightness
> (the latter will also stop sw blinking)
> v3: - make LEDS_CLASS a bool rather than tristate
> because LEDS_TRIGGERS now depends on symbols
> it exports

`make oldconfig' says

boolean symbol LEDS_CLASS tested for 'm'? test forced to 'n'
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/