LED devices

Richard Purdie rpurdie at openedhand.com
Fri Jun 1 12:43:41 PDT 2007


On Fri, 2007-06-01 at 05:20 -0700, Greg KH wrote:
> On Thu, May 31, 2007 at 09:26:25AM +0100, Richard Purdie wrote:
> > On Thu, 2007-05-31 at 00:24 -0700, Greg KH wrote:
> > > > The first contains no useful information, the second one is only
> > > > fractionally better, the third is actually quite useful. Faced with the
> > > > third name, a person can actually point to the right LED on the device.
> > > 
> > > So?  You need to read the attributes in the sysfs device directory to
> > > find out exactly what type of device this is, what it does, and all
> > > sorts of other information.
> > > 
> > > The first two examples above are correct.  They use a "bus id" type
> > > naming scheme, like ALL OTHER DEVICES IN THE KERNEL.  The only
> > > requirement is that it is unique.
> > 
> > So as long as the name is unique, a class can use whatever naming scheme
> > it likes?
> 
> Within reason, yes.  I view the proposed naming scheme as not reasonable
> though :)

What I fail to understand is why having some notion of function in the
name is reasonable yet colour is not (and vice versa). All the naming
scheme says is that if we're going to have these entities in the names
(which most people actually want), we might as well standardise the
format.

All my patch does is goes one step further and ensures people get it
right.

Please note I'm not saying that any old attributes can be added to the
name. The documentation mentioned two specific hints, I agree a third
would be useful (function). I can't think of anything further that
should be there. Obviously I don't know what the future holds and the
scheme is extensible but I can't honestly see it changing further.

> > If any information in the name also appears as an attribute, that would
> > be acceptable?
> 
> Why "also"?

Richard went on to submit patches that keep colour and function in the
names but doesn't have an standardised format. Why deliberately write
something out the system that doesn't cost anything and is potentially
useful, even if only to the human debugger if nothing else?

I say "also" since if we accept there is some information in the name we
need to duplicate it to conform to these sysfs standards I keep hearing
about. My patch does this without bothering the drivers or duplicating
it from their point of view.

I also question the usefulness of this information to userspace.
Physical properties of LEDs like brightness and some idea whats
controlling them (triggers) are very useful. Some kind of identification
is also useful (the name). I can't see a general use for properties like
function and colour on their own, other than for device identification
purposes which is what a good device name is for.

Regards,

Richard




More information about the hal mailing list