LED devices

Richard Hughes hughsient at gmail.com
Wed May 30 05:35:59 PDT 2007


On Wed, 2007-05-30 at 14:21 +0200, Danny Kukawka wrote:
> On Mittwoch, 30. Mai 2007, Richard Hughes wrote:
> > The led framework (as is) is pretty sparse on information, and we can't
> > really get many capabilities (if the light can flash, what colour the
> > light is) although I'm prepared to code the kernel changes if need be.
> 
> I discussed the LED issues already with Richard Purdie (the maintainer of the 
> led subsystem) and wrote a patch to change the naming of the led devices in 
> sysfs, because I worked on a patch to handle LED devices in HAL. Richard 
> doesn't want to start having extra device attributes in sysfs for this. The 
> new changed naming would include the function and colour of the led.

The new devices look like:

/sys/class/leds/thinklight\:white/brightness

An attribute in sysfs would be better than trying to parse the name of
the device. Doing the latter seems a poor solution when sysfs is meant
to be one value per file and easy to parse.

What's the big problem having names such as "thinklight" and then
another attribute of "color"?

> I have to check if changes we discussed are already in the kernel. If so, I 
> could send a patch to the ML to handle LEDs via HAL - need only to include 
> the changes into my code (and testing). 

Sure, could you attach what you've got, and then I can test it my end
also. This isn't top priority for me, but it would be a nice feature to
have.

> Btw. The LED handling is not that easy because there are some devices which 
> have several functions via the same device in sysfs. They need to get handled 
> via change the trigger.

Sure, I don't think we should be setting any device from userspace that
has a trigger - would that solve the issues?

Thanks.

Richard..




More information about the hal mailing list