LED devices

Richard Purdie rpurdie at openedhand.com
Fri Jun 1 05:59:35 PDT 2007


On Fri, 2007-06-01 at 13:36 +0100, Richard Hughes wrote:
> On Fri, 2007-06-01 at 13:18 +0100, Richard Purdie wrote:
> > On Fri, 2007-06-01 at 13:04 +0100, Richard Hughes wrote:
> > Several reasons:
> > 
> > * I want to keep the names descriptive (which is allowed afaict)
> 
> Then we can use apple_power_on, thinkpad_charging, logitech_low_power.
> The colour of the led is not always the best descriptor.

Agreed, which is why I've said I'll accept some optional notion of
function in the name by extending the API as discussed previously.

Of course by your own argument we'll have to provide a property
attribute for that too since conveying that information in the name only
isn't allowed.

> > * If we remove colour from the names we break the existing API as
> > documented.
> 
> No, we don't have to break API, we just say that in future you don't
> have to put the colour appended to the device name. You can continue to
> use spitz:red if you want, but we shouldn't assume everybody wants to do
> this.

Its optional now...

> And these were the two main led class users I could find in drivers.
>
> Your argument about breaking name:colour API looks a little weak, as 
> it appears nearly nothing in-tree actually uses it.

Look harder, there are at least the following users using that naming
scheme just in drivers/leds:

leds-corgi
leds-tosa
leds-spitz
leds-h1940
leds-locomo
leds-gpio
leds-ixp4xx-gpio

> > * Drivers should only specify the colour in one place.
> 
> Yup. Agree, which to me suggests that a descriptor to the led
> "discharging" is better than "amber", and then if the led colour ever
> changes from model to model (like the thinklight) then we only have to
> change one property and not the device name.

The LED function changes model to model too. The spitz driver works on
two models, one where the green LED is marked as mail, the other where
it is marked as HDD activity. So no, that argument doesn't stand up.

Regards,

Richard



More information about the hal mailing list