[U-Boot] [RFC PATCH 3/3] at91: use generic gpio API for AT91_LED

Andreas Bießmann
2013-10-29T12:53:11Z

Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
---
arch/arm/cpu/arm926ejs/at91/led.c | 43 +++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)

diff --git a/arch/arm/cpu/arm926ejs/at91/led.c b/arch/arm/cpu/arm926ejs/at91/led.c
index 5dd9048..9dcba7a 100644
--- a/arch/arm/cpu/arm926ejs/at91/led.c
+++ b/arch/arm/cpu/arm926ejs/at91/led.c
@@ -7,6 +7,9 @@
*/

#include <common.h>
+
+#ifdef CONFIG_ATMEL_LEGACY
+
#include <asm/io.h>
#include <asm/arch/at91_pmc.h>
#include <asm/arch/at91_pio.h>
@@ -47,3 +50,43 @@ void yellow_led_off(void)
at91_set_gpio_value(CONFIG_YELLOW_LED, 1);
}
#endif
+#else /* CONFIG_ATMEL_LEGACY */
+
+#include <asm/gpio.h>
+
+#ifdef CONFIG_RED_LED
+void red_led_on(void)
+{
+ gpio_set_value(CONFIG_RED_LED, 1);
+}
+
+void red_led_off(void)
+{
+ gpio_set_value(CONFIG_RED_LED, 0);
+}
+#endif
+
+#ifdef CONFIG_GREEN_LED
+void green_led_on(void)
+{
+ gpio_set_value(CONFIG_GREEN_LED, 0);
+}
+
+void green_led_off(void)
+{
+ gpio_set_value(CONFIG_GREEN_LED, 1);
+}
+#endif
+
+#ifdef CONFIG_YELLOW_LED
+void yellow_led_on(void)
+{
+ gpio_set_value(CONFIG_YELLOW_LED, 0);
+}
+
+void yellow_led_off(void)
+{
+ gpio_set_value(CONFIG_YELLOW_LED, 1);
+}
+#endif
+#endif /* CONFIG_ATMEL_LEGACY */
--
1.7.10.4