Re: [PATCH] input: extend EV_LED

From: Henrique de Moraes Holschuh
Date: Sun Feb 18 2007 - 09:42:49 EST

On Sun, 18 Feb 2007, Richard Purdie wrote:
> I just said that finding a way to do it generically is difficult, not
> that we shouldn't do it.

Very well, let's do it, then.

> Even if half your functionality is exposed through the class, that half
> that is standardised rather than adhoc. Having said that, you shouldn't
> need any custom attributes though.

Yes, that's my point. Blinking is too common, it needs to be generic (and I
don't care if it is done through triggers, as long as it is generic *and*
hardware-implementation-friendly, I will use it).

> Right, but blinking is not an LED attribute but more of an action for
> the LED so what we need is an LED blink trigger. Rather than the timer
> trigger which takes a variety of options, this blink trigger could just
> take an on/off value. In the absence of hardware capability, we can
> emulate it. I like the idea of a simple blink trigger...

If you have a 2.6.20 backport of the new LED class, I could work on it when
I finish the ibm-acpi conversion to sysfs, which should take about one more

> If a trigger/attribute appears for an LED, its behaviour needs to be the
> same for all LEDs.


BTW: I need to have two leds that are the same device, different colors.
The code already handles this just fine (it is NOT a multicolor led), I'd
like to know how should I name the parameter?

power:green and power:yellow?

That should be done in a standard way as well.

> The enum reflects a spectrum of loosely defined frequencies, a bit like
> brightness maybe in a range 0-6. The idea is these are loose definitions
> and the driver will attempt a loose match, using any hardware blinking
> if available.

Add the following functionality, and I think I would be happy with the

1. A way for the driver to say "led access is expensive, do not enable
software blink emulation" (maybe you already have this...)

2. A way for userspace to either know which ranges are hardware-emulated, or
to request that only hardware emulation be used.

I can live with just (1), but I think (2) would make the interface more
complete. Keep in mind that whatever can be hardware-emulated is probably
the default way to use that led, so it is an interesting data-point for

"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@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at