LED devices

Richard Hughes hughsient at gmail.com
Fri Jun 1 07:28:10 PDT 2007


On Fri, 2007-06-01 at 16:20 +0200, Johannes Berg wrote:
> On Fri, 2007-06-01 at 13:36 +0100, Richard Hughes wrote:
> 
> > +       rc = class_device_create_file(led_cdev->class_dev,
> > +                                     &class_device_attr_colour);
> > +       if (rc)
> > +               goto err_out_colour;
> 
> I think you need some "if (led_cdev->colour)" here so there's no colour
> attribute when the colour isn't specified. Other than that, I like it.

Indeed, cheers.

> What I'd also like to see is have an LED be associated with some other
> device, as a parent. So instead of being pure "class devs" they could
> live in say /sys/devices/pci0002:24/0002:24:0f.0/led/ like we now
> have /sys/devices/pci0002:24/0002:24:0f.0/net/.

Sure, but for another day :-)

> And then there's one more thing, I'd like to have triggers associated
> with devices as well, but those are currently not entities in sysfs at
> all, unfortunately.

Richard, what do you think of this?

> The reason I'm saying this is that we'd love to export things like
> "ieee80211:phy1:rx" as an LED trigger for the RX led on wireless phy1,
> and have hardware drivers also export LEDs when say the PCMCIA card you
> inserted has an LED. Then if both were sysfs entities userspace could
> easily detect this and hook up the right LED to the right trigger by
> default. Or, the kernel could, but right now you need to specify a name
> for the trigger, in my example above I'd like to actually specify
> "ieee80211:%s:rx" as the trigger name and have that %s filled in with
> the parent device name.

Seems useful to me.

Richard.




More information about the hal mailing list