From: Marc Reilly <marc@cpdesign.com.au>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/7] basic LED support
Date: Mon, 20 Dec 2010 08:31:34 +1100 [thread overview]
Message-ID: <201012200831.34131.marc@cpdesign.com.au> (raw)
In-Reply-To: <1292685309-32326-3-git-send-email-s.hauer@pengutronix.de>
Hi Sascha,
Thanks, this works well for my board. (tri colour led).
Was drivers/led/led-triggers.c missing from the patch set?
I haven't been able to compile with trigger support...
> +/**
> + * led_register - Register a LED
> + * @param led the led
> + */
> +int led_register(struct led *led)
> +{
> + led->num = num_leds++;
> +
> + list_add_tail(&led->list, &leds);
> +
> + return 0;
> +}
How about being able to register a led at a specific number? This means that
boot/init scripts that want to interact with leds don't rely on the order that
they are registered.
I also like the suggestion of associating a name to LEDs. This may even be a
better fit for scripting than reserved numbering.
> +
> +/**
> + * led_unregister - Unegister a LED
> + * @param led the led
> + */
> +void led_unregister(struct led *led)
> +{
> + list_del(&led->list);
> +}
> diff --git a/include/led.h b/include/led.h
> new file mode 100644
> index 0000000..62d0d08
> --- /dev/null
> +++ b/include/led.h
> @@ -0,0 +1,25 @@
> +#ifndef __LED_H
> +#define __LED_H
> +
> +struct led {
> + unsigned long triger;
Spelling typo? (Should this be trigger ?)
> + void (*set)(struct led *, unsigned int value);
> + int max_value;
> + int num;
> + struct list_head list;
> +};
> +
> +struct led *led_by_number(int no);
> +
Cheers
Marc
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2010-12-19 21:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-18 15:15 LED framework Sascha Hauer
2010-12-18 15:15 ` [PATCH 1/7] Add generic poll infrastructure Sascha Hauer
2010-12-18 15:28 ` Sascha Hauer
2010-12-18 15:15 ` [PATCH 2/7] basic LED support Sascha Hauer
2010-12-18 16:38 ` Jean-Christophe PLAGNIOL-VILLARD
2010-12-18 17:18 ` Sascha Hauer
2010-12-18 16:48 ` Jean-Christophe PLAGNIOL-VILLARD
2010-12-18 19:06 ` Belisko Marek
2010-12-19 21:31 ` Marc Reilly [this message]
2010-12-20 8:27 ` Sascha Hauer
2010-12-18 15:15 ` [PATCH 3/7] LED: Add gpio " Sascha Hauer
2010-12-18 16:41 ` Jean-Christophe PLAGNIOL-VILLARD
2010-12-18 17:18 ` Sascha Hauer
2010-12-18 15:15 ` [PATCH 4/7] LED: Add LED trigger support Sascha Hauer
2010-12-18 16:51 ` Belisko Marek
2010-12-18 17:21 ` Sascha Hauer
2010-12-18 15:15 ` [PATCH 5/7] LED: Add led command Sascha Hauer
2010-12-18 16:45 ` Jean-Christophe PLAGNIOL-VILLARD
2010-12-18 17:24 ` Sascha Hauer
2010-12-18 15:15 ` [PATCH 6/7] LED: Add trigger command Sascha Hauer
2010-12-18 15:15 ` [PATCH 7/7] pcm038: led testing. Not to be committed Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201012200831.34131.marc@cpdesign.com.au \
--to=marc@cpdesign.com.au \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.