]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
at91: switch coloured LED to gpio API
authorAndreas Bießmann <andreas.devel@googlemail.com>
Fri, 29 Nov 2013 11:13:46 +0000 (12:13 +0100)
committerAndreas Bießmann <andreas.devel@googlemail.com>
Mon, 9 Dec 2013 12:21:47 +0000 (13:21 +0100)
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
arch/arm/cpu/arm926ejs/at91/led.c
board/ronetix/pm9261/led.c
board/ronetix/pm9263/led.c
include/configs/pm9261.h
include/configs/pm9263.h
include/configs/pm9g45.h

index 5dd90487eddc6edcdc1802580aff4597bb522569..46ed055023978aee455ccfdb74155c31705ebb41 100644 (file)
@@ -7,43 +7,41 @@
  */
 
 #include <common.h>
  */
 
 #include <common.h>
-#include <asm/io.h>
-#include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_pio.h>
+#include <asm/gpio.h>
 #include <asm/arch/gpio.h>
 
 #ifdef CONFIG_RED_LED
 void red_led_on(void)
 {
 #include <asm/arch/gpio.h>
 
 #ifdef CONFIG_RED_LED
 void red_led_on(void)
 {
-       at91_set_gpio_value(CONFIG_RED_LED, 1);
+       gpio_set_value(CONFIG_RED_LED, 1);
 }
 
 void red_led_off(void)
 {
 }
 
 void red_led_off(void)
 {
-       at91_set_gpio_value(CONFIG_RED_LED, 0);
+       gpio_set_value(CONFIG_RED_LED, 0);
 }
 #endif
 
 #ifdef CONFIG_GREEN_LED
 void green_led_on(void)
 {
 }
 #endif
 
 #ifdef CONFIG_GREEN_LED
 void green_led_on(void)
 {
-       at91_set_gpio_value(CONFIG_GREEN_LED, 0);
+       gpio_set_value(CONFIG_GREEN_LED, 0);
 }
 
 void green_led_off(void)
 {
 }
 
 void green_led_off(void)
 {
-       at91_set_gpio_value(CONFIG_GREEN_LED, 1);
+       gpio_set_value(CONFIG_GREEN_LED, 1);
 }
 #endif
 
 #ifdef CONFIG_YELLOW_LED
 void yellow_led_on(void)
 {
 }
 #endif
 
 #ifdef CONFIG_YELLOW_LED
 void yellow_led_on(void)
 {
-       at91_set_gpio_value(CONFIG_YELLOW_LED, 0);
+       gpio_set_value(CONFIG_YELLOW_LED, 0);
 }
 
 void yellow_led_off(void)
 {
 }
 
 void yellow_led_off(void)
 {
-       at91_set_gpio_value(CONFIG_YELLOW_LED, 1);
+       gpio_set_value(CONFIG_YELLOW_LED, 1);
 }
 #endif
 }
 #endif
index 223a5161797f23ea180fba1ace40653a69dcebb8..cc4c2a072bb06298e0b8a46115b1a8e437f6b4b0 100644 (file)
@@ -8,9 +8,9 @@
  */
 
 #include <common.h>
  */
 
 #include <common.h>
+#include <asm/gpio.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/gpio.h>
-#include <asm/io.h>
 
 void coloured_LED_init(void)
 {
 
 void coloured_LED_init(void)
 {
@@ -19,11 +19,11 @@ void coloured_LED_init(void)
        /* Enable clock */
        writel(1 << ATMEL_ID_PIOC, &pmc->pcer);
 
        /* Enable clock */
        writel(1 << ATMEL_ID_PIOC, &pmc->pcer);
 
-       at91_set_pio_output(CONFIG_RED_LED, 1);
-       at91_set_pio_output(CONFIG_GREEN_LED, 1);
-       at91_set_pio_output(CONFIG_YELLOW_LED, 1);
+       gpio_direction_output(CONFIG_RED_LED, 1);
+       gpio_direction_output(CONFIG_GREEN_LED, 1);
+       gpio_direction_output(CONFIG_YELLOW_LED, 1);
 
 
-       at91_set_pio_value(CONFIG_RED_LED, 0);
-       at91_set_pio_value(CONFIG_GREEN_LED, 1);
-       at91_set_pio_value(CONFIG_YELLOW_LED, 1);
+       gpio_set_value(CONFIG_RED_LED, 0);
+       gpio_set_value(CONFIG_GREEN_LED, 1);
+       gpio_set_value(CONFIG_YELLOW_LED, 1);
 }
 }
index 44e34309009d29e59e970663b58bb4dedc01ae57..bfc2310b0e22343510da499c2bb979ff0ca4d842 100644 (file)
@@ -8,9 +8,9 @@
  */
 
 #include <common.h>
  */
 
 #include <common.h>
+#include <asm/gpio.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/gpio.h>
-#include <asm/io.h>
 
 void coloured_LED_init(void)
 {
 
 void coloured_LED_init(void)
 {
@@ -19,9 +19,9 @@ void coloured_LED_init(void)
        /* Enable clock */
        writel(1 << ATMEL_ID_PIOB, &pmc->pcer);
 
        /* Enable clock */
        writel(1 << ATMEL_ID_PIOB, &pmc->pcer);
 
-       at91_set_pio_output(CONFIG_RED_LED, 1);
-       at91_set_pio_output(CONFIG_GREEN_LED, 1);
+       gpio_direction_output(CONFIG_RED_LED, 1);
+       gpio_direction_output(CONFIG_GREEN_LED, 1);
 
 
-       at91_set_pio_value(CONFIG_RED_LED, 0);
-       at91_set_pio_value(CONFIG_GREEN_LED, 1);
+       gpio_set_value(CONFIG_RED_LED, 0);
+       gpio_set_value(CONFIG_GREEN_LED, 1);
 }
 }
index f977e25b8737460846b08ba651d6b345df5fb68e..4a71927217c67a83a3dcdabfd068f4ac4d27b458 100644 (file)
 
 /* LED */
 #define CONFIG_AT91_LED
 
 /* LED */
 #define CONFIG_AT91_LED
-#define        CONFIG_RED_LED          AT91_PIO_PORTC, 12
-#define        CONFIG_GREEN_LED        AT91_PIO_PORTC, 13
-#define        CONFIG_YELLOW_LED       AT91_PIO_PORTC, 15
+#define CONFIG_RED_LED         GPIO_PIN_PC(12)
+#define CONFIG_GREEN_LED       GPIO_PIN_PC(13)
+#define CONFIG_YELLOW_LED      GPIO_PIN_PC(15)
 
 #define CONFIG_BOOTDELAY       3
 
 
 #define CONFIG_BOOTDELAY       3
 
index dffc3365c6f02fd507729cdf87ee80bf1d48f25b..d9c04d14b96c027510dc61fb2b4f247b35ff4962 100644 (file)
 
 /* LED */
 #define CONFIG_AT91_LED
 
 /* LED */
 #define CONFIG_AT91_LED
-#define        CONFIG_RED_LED          AT91_PIO_PORTB, 7       /* this is the power led */
-#define        CONFIG_GREEN_LED        AT91_PIO_PORTB, 8       /* this is the user1 led */
+#define CONFIG_RED_LED         GPIO_PIN_PB(7) /* this is the power led */
+#define CONFIG_GREEN_LED       GPIO_PIN_PB(8) /* this is the user1 led */
 
 #define CONFIG_BOOTDELAY       3
 
 
 #define CONFIG_BOOTDELAY       3
 
index 03a25c8230b7190f57b82f89a1e7d1de26f3f7f5..f78e0ec173e0f1fecf09eed1f1420810ee0b6922 100644 (file)
@@ -54,8 +54,8 @@
 
 /* LED */
 #define CONFIG_AT91_LED
 
 /* LED */
 #define CONFIG_AT91_LED
-#define        CONFIG_RED_LED          AT91_PIO_PORTD, 31 /* this is the user1 led */
-#define        CONFIG_GREEN_LED        AT91_PIO_PORTD, 0 /* this is the user2 led */
+#define CONFIG_RED_LED         GPIO_PIN_PD(31) /* this is the user1 led */
+#define CONFIG_GREEN_LED       GPIO_PIN_PD(0)  /* this is the user2 led */
 
 #define CONFIG_BOOTDELAY       3
 
 
 #define CONFIG_BOOTDELAY       3