public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] AT91: Add support for blue_LED_* and add coloured_LED_init to at91/led.c
@ 2009-08-12 16:10 Albin Tonnerre
  2009-08-12 21:15 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 11+ messages in thread
From: Albin Tonnerre @ 2009-08-12 16:10 UTC (permalink / raw)
  To: u-boot

Currently, at91/led.c only provides _on and _off functions for green,
yellow and red LEDs. This patch provides a generic coloured_LED_init
function, which is a first step towards getting rid of the
board-specific (and duplicated) board/*/*/led.c files on at91
This patch alos adds similar support for blue LEDs, mostly for the sake
of completeness.

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
---
 cpu/arm926ejs/at91/led.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/cpu/arm926ejs/at91/led.c b/cpu/arm926ejs/at91/led.c
index be68f59..f6b1912 100644
--- a/cpu/arm926ejs/at91/led.c
+++ b/cpu/arm926ejs/at91/led.c
@@ -27,6 +27,26 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/io.h>
 
+void coloured_LED_init(void)
+{
+#ifdef CONFIG_RED_LED
+	at91_set_gpio_output(CONFIG_RED_LED, 0);
+	red_LED_off();
+#endif
+#ifdef CONFIG_GREEN_LED
+	at91_set_gpio_output(CONFIG_GREEN_LED, 0);
+	green_LED_off();
+#endif
+#ifdef CONFIG_YELLOW_LED
+	at91_set_gpio_output(CONFIG_YELLOW_LED, 0);
+	yellow_LED_off();
+#endif
+#ifdef CONFIG_BLUE_LED
+	at91_set_gpio_output(CONFIG_BLUE_LED, 0);
+	blue_LED_off();
+#endif
+}
+
 #ifdef CONFIG_RED_LED
 void red_LED_on(void)
 {
@@ -62,3 +82,15 @@ void yellow_LED_off(void)
 	at91_set_gpio_value(CONFIG_YELLOW_LED, 1);
 }
 #endif
+
+#ifdef CONFIG_BLUE_LED
+void blue_LED_on(void)
+{
+	at91_set_gpio_value(CONFIG_BLUE_LED, 0);
+}
+
+void blue_LED_off(void)
+{
+	at91_set_gpio_value(CONFIG_BLUE_LED, 1);
+}
+#endif
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-09-05 13:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-12 16:10 [U-Boot] [PATCH] AT91: Add support for blue_LED_* and add coloured_LED_init to at91/led.c Albin Tonnerre
2009-08-12 21:15 ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-12 21:39   ` Albin Tonnerre
2009-08-17 22:51     ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-18  8:49       ` Albin Tonnerre
2009-08-20  0:00         ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-20  8:36           ` Albin Tonnerre
2009-08-21 21:41             ` Wolfgang Denk
2009-09-04 23:47             ` Jean-Christophe PLAGNIOL-VILLARD
2009-09-05 11:20               ` Albin Tonnerre
2009-09-05 13:31                 ` Jean-Christophe PLAGNIOL-VILLARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox