LED devices
Johannes Berg
johannes at sipsolutions.net
Fri Jun 1 07:20:54 PDT 2007
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.
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/.
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.
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.
johannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/hal/attachments/20070601/41b153c6/attachment.pgp
More information about the hal
mailing list