mirror of
https://xff.cz/git/u-boot/
synced 2025-09-07 11:42:13 +02:00
at91: switch coloured LED to gpio API
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
This commit is contained in:
@@ -7,43 +7,41 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <asm/io.h>
|
#include <asm/gpio.h>
|
||||||
#include <asm/arch/at91_pmc.h>
|
|
||||||
#include <asm/arch/at91_pio.h>
|
|
||||||
#include <asm/arch/gpio.h>
|
#include <asm/arch/gpio.h>
|
||||||
|
|
||||||
#ifdef CONFIG_RED_LED
|
#ifdef CONFIG_RED_LED
|
||||||
void red_led_on(void)
|
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
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_GREEN_LED
|
#ifdef CONFIG_GREEN_LED
|
||||||
void green_led_on(void)
|
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
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_YELLOW_LED
|
#ifdef CONFIG_YELLOW_LED
|
||||||
void yellow_led_on(void)
|
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
|
||||||
|
@@ -8,9 +8,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
#include <asm/gpio.h>
|
||||||
#include <asm/arch/at91_pmc.h>
|
#include <asm/arch/at91_pmc.h>
|
||||||
#include <asm/arch/gpio.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 */
|
/* Enable clock */
|
||||||
writel(1 << ATMEL_ID_PIOC, &pmc->pcer);
|
writel(1 << ATMEL_ID_PIOC, &pmc->pcer);
|
||||||
|
|
||||||
at91_set_pio_output(CONFIG_RED_LED, 1);
|
gpio_direction_output(CONFIG_RED_LED, 1);
|
||||||
at91_set_pio_output(CONFIG_GREEN_LED, 1);
|
gpio_direction_output(CONFIG_GREEN_LED, 1);
|
||||||
at91_set_pio_output(CONFIG_YELLOW_LED, 1);
|
gpio_direction_output(CONFIG_YELLOW_LED, 1);
|
||||||
|
|
||||||
at91_set_pio_value(CONFIG_RED_LED, 0);
|
gpio_set_value(CONFIG_RED_LED, 0);
|
||||||
at91_set_pio_value(CONFIG_GREEN_LED, 1);
|
gpio_set_value(CONFIG_GREEN_LED, 1);
|
||||||
at91_set_pio_value(CONFIG_YELLOW_LED, 1);
|
gpio_set_value(CONFIG_YELLOW_LED, 1);
|
||||||
}
|
}
|
||||||
|
@@ -8,9 +8,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
#include <asm/gpio.h>
|
||||||
#include <asm/arch/at91_pmc.h>
|
#include <asm/arch/at91_pmc.h>
|
||||||
#include <asm/arch/gpio.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 */
|
/* Enable clock */
|
||||||
writel(1 << ATMEL_ID_PIOB, &pmc->pcer);
|
writel(1 << ATMEL_ID_PIOB, &pmc->pcer);
|
||||||
|
|
||||||
at91_set_pio_output(CONFIG_RED_LED, 1);
|
gpio_direction_output(CONFIG_RED_LED, 1);
|
||||||
at91_set_pio_output(CONFIG_GREEN_LED, 1);
|
gpio_direction_output(CONFIG_GREEN_LED, 1);
|
||||||
|
|
||||||
at91_set_pio_value(CONFIG_RED_LED, 0);
|
gpio_set_value(CONFIG_RED_LED, 0);
|
||||||
at91_set_pio_value(CONFIG_GREEN_LED, 1);
|
gpio_set_value(CONFIG_GREEN_LED, 1);
|
||||||
}
|
}
|
||||||
|
@@ -164,9 +164,9 @@
|
|||||||
|
|
||||||
/* LED */
|
/* LED */
|
||||||
#define CONFIG_AT91_LED
|
#define CONFIG_AT91_LED
|
||||||
#define CONFIG_RED_LED AT91_PIO_PORTC, 12
|
#define CONFIG_RED_LED GPIO_PIN_PC(12)
|
||||||
#define CONFIG_GREEN_LED AT91_PIO_PORTC, 13
|
#define CONFIG_GREEN_LED GPIO_PIN_PC(13)
|
||||||
#define CONFIG_YELLOW_LED AT91_PIO_PORTC, 15
|
#define CONFIG_YELLOW_LED GPIO_PIN_PC(15)
|
||||||
|
|
||||||
#define CONFIG_BOOTDELAY 3
|
#define CONFIG_BOOTDELAY 3
|
||||||
|
|
||||||
|
@@ -179,8 +179,8 @@
|
|||||||
|
|
||||||
/* LED */
|
/* LED */
|
||||||
#define CONFIG_AT91_LED
|
#define CONFIG_AT91_LED
|
||||||
#define CONFIG_RED_LED AT91_PIO_PORTB, 7 /* this is the power led */
|
#define CONFIG_RED_LED GPIO_PIN_PB(7) /* this is the power led */
|
||||||
#define CONFIG_GREEN_LED AT91_PIO_PORTB, 8 /* this is the user1 led */
|
#define CONFIG_GREEN_LED GPIO_PIN_PB(8) /* this is the user1 led */
|
||||||
|
|
||||||
#define CONFIG_BOOTDELAY 3
|
#define CONFIG_BOOTDELAY 3
|
||||||
|
|
||||||
|
@@ -54,8 +54,8 @@
|
|||||||
|
|
||||||
/* LED */
|
/* LED */
|
||||||
#define CONFIG_AT91_LED
|
#define CONFIG_AT91_LED
|
||||||
#define CONFIG_RED_LED AT91_PIO_PORTD, 31 /* this is the user1 led */
|
#define CONFIG_RED_LED GPIO_PIN_PD(31) /* this is the user1 led */
|
||||||
#define CONFIG_GREEN_LED AT91_PIO_PORTD, 0 /* this is the user2 led */
|
#define CONFIG_GREEN_LED GPIO_PIN_PD(0) /* this is the user2 led */
|
||||||
|
|
||||||
#define CONFIG_BOOTDELAY 3
|
#define CONFIG_BOOTDELAY 3
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user