Re: best way to handle LEDs

From: Chase Venters
Date: Wed Nov 02 2005 - 03:03:16 EST


On Tuesday 01 November 2005 06:38 pm, Richard Purdie wrote:
> led triggers would be connected to leds via sysfs. Each trigger would
> probably have a number you could echo into an led's trigger attribute.
> Sensible default mappings could be had by assigning a default trigger to
> a device by name in the platform code that declares the led.
>
> A trigger of "0" would mean the led becomes under userspace control via
> sysfs for whatever userspace wishes to do with it.

Any reason to represent the triggers as numbers in sysfs? I'm a fan of how the
IO scheduler is chosen on a block device. The file looks like:

noop [anticipatory] deadline cfq

You get a list of all available triggers, which one is active (and it's easy
enough for user space code to parse). Obviously, to select a trigger, you
just write its name to the file. Instead of 0, you say user, etc...

Cheers,
Chase Venters
-
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/