Re: [PATCH 2.6.8.1 0/2] leds: new class for led devices

From: Russell King
Date: Sat Sep 04 2004 - 15:55:02 EST


On Sat, Sep 04, 2004 at 01:12:02PM +0200, Pavel Machek wrote:
> Hi!
>
> > The kernel is NOT in sole control today on ARM platforms:
> >
> > echo claim > /sys/devices/system/leds/leds0/event
> > echo red on > /sys/devices/system/leds/leds0/event
> > echo green on > /sys/devices/system/leds/leds0/event
> > echo red off > /sys/devices/system/leds/leds0/event
> > echo release > /sys/devices/system/leds/leds0/event
> >
> > etc
> >
> > Sure, we have a weird naming scheme (red, green, amber, blue) but
> > that came around because that's what people were dealing with.
> > There's nothing really stopping us from having any name for a LED
> > in the existing scheme.
> >
> > I just don't buy the "we must have one sysfs node for every LED"
> > argument.
>
> sysfs is one-file-one-value. We do not want to end up with /proc-like
> mess.

In which case I protest in the strongest terms that having one device
node plus attributes _PER_ _LED_ is just fscking stupid. What if you
have an embedded machine with 32 LEDs? Do you _really_ need all that
extra data just to support sysfs so that maybe you can control them
from userspace?

What next? One sysfs node plus attributes per GPIO line? How about
we do one sysfs node per virtual memory bit so people can control
anything in their system on a bit granularity without needing mmap
or any other interfaces? When does this madness stop?

It comes down to this:
- is a single LED in one package one device?
- is a set of two LEDs in one package one device?
- is a set of three LEDs in one package a device?
- what about a bank of 8 LEDs grouped together?
- what about 4 banks of 8 LEDs grouped together?
- what about 7 segment numeric LED displays?
- what about 14 segment alphanumeric LED displays?

All of these are LED devices. Does one sysfs node per individual LED
element _really_ make sense for all these cases? I think not.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
-
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/