From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/4] at91: switch coloured LED to gpio API
Date: Fri, 29 Nov 2013 12:13:46 +0100 [thread overview]
Message-ID: <1385723626-1586-5-git-send-email-andreas.devel@googlemail.com> (raw)
In-Reply-To: <1385723626-1586-1-git-send-email-andreas.devel@googlemail.com>
Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
---
arch/arm/cpu/arm926ejs/at91/led.c | 16 +++++++---------
board/ronetix/pm9261/led.c | 14 +++++++-------
board/ronetix/pm9263/led.c | 10 +++++-----
include/configs/pm9261.h | 6 +++---
include/configs/pm9263.h | 4 ++--
include/configs/pm9g45.h | 4 ++--
6 files changed, 26 insertions(+), 28 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/at91/led.c b/arch/arm/cpu/arm926ejs/at91/led.c
index 5dd9048..46ed055 100644
--- a/arch/arm/cpu/arm926ejs/at91/led.c
+++ b/arch/arm/cpu/arm926ejs/at91/led.c
@@ -7,43 +7,41 @@
*/
#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)
{
- at91_set_gpio_value(CONFIG_RED_LED, 1);
+ gpio_set_value(CONFIG_RED_LED, 1);
}
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)
{
- at91_set_gpio_value(CONFIG_GREEN_LED, 0);
+ gpio_set_value(CONFIG_GREEN_LED, 0);
}
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)
{
- at91_set_gpio_value(CONFIG_YELLOW_LED, 0);
+ gpio_set_value(CONFIG_YELLOW_LED, 0);
}
void yellow_led_off(void)
{
- at91_set_gpio_value(CONFIG_YELLOW_LED, 1);
+ gpio_set_value(CONFIG_YELLOW_LED, 1);
}
#endif
diff --git a/board/ronetix/pm9261/led.c b/board/ronetix/pm9261/led.c
index 223a516..cc4c2a0 100644
--- a/board/ronetix/pm9261/led.c
+++ b/board/ronetix/pm9261/led.c
@@ -8,9 +8,9 @@
*/
#include <common.h>
+#include <asm/gpio.h>
#include <asm/arch/at91_pmc.h>
#include <asm/arch/gpio.h>
-#include <asm/io.h>
void coloured_LED_init(void)
{
@@ -19,11 +19,11 @@ void coloured_LED_init(void)
/* 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);
}
diff --git a/board/ronetix/pm9263/led.c b/board/ronetix/pm9263/led.c
index 44e3430..bfc2310 100644
--- a/board/ronetix/pm9263/led.c
+++ b/board/ronetix/pm9263/led.c
@@ -8,9 +8,9 @@
*/
#include <common.h>
+#include <asm/gpio.h>
#include <asm/arch/at91_pmc.h>
#include <asm/arch/gpio.h>
-#include <asm/io.h>
void coloured_LED_init(void)
{
@@ -19,9 +19,9 @@ void coloured_LED_init(void)
/* 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);
}
diff --git a/include/configs/pm9261.h b/include/configs/pm9261.h
index 9442d8f..0f3cfba 100644
--- a/include/configs/pm9261.h
+++ b/include/configs/pm9261.h
@@ -166,9 +166,9 @@
/* 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
diff --git a/include/configs/pm9263.h b/include/configs/pm9263.h
index dffc336..d9c04d1 100644
--- a/include/configs/pm9263.h
+++ b/include/configs/pm9263.h
@@ -179,8 +179,8 @@
/* 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
diff --git a/include/configs/pm9g45.h b/include/configs/pm9g45.h
index 03a25c8..f78e0ec 100644
--- a/include/configs/pm9g45.h
+++ b/include/configs/pm9g45.h
@@ -54,8 +54,8 @@
/* 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
--
1.7.10.4
next prev parent reply other threads:[~2013-11-29 11:13 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 12:53 [U-Boot] [RFC PATCH 0/3] at91: remove legacy gpio API Andreas Bießmann
2013-10-29 12:53 ` [U-Boot] [RFC PATCH 1/3] at91: add new gpio pin macros Andreas Bießmann
2013-10-30 9:56 ` Bo Shen
2013-10-30 10:39 ` Andreas Bießmann
2013-10-30 17:19 ` Jens Scharsig
2013-10-30 18:59 ` Andreas Bießmann
2013-10-31 5:04 ` Heiko Schocher
2013-10-29 12:53 ` [U-Boot] [RFC PATCH 2/3] at91sam9263ek: remove ATMEL_LEGACY Andreas Bießmann
2013-10-29 12:53 ` [U-Boot] [RFC PATCH 3/3] at91: use generic gpio API for AT91_LED Andreas Bießmann
2013-11-29 11:13 ` [U-Boot] [PATCH 0/4] at91: remove legacy GPIO API (part 1) Andreas Bießmann
2013-11-29 11:13 ` [U-Boot] [PATCH 1/4] at91: add new gpio pin definitions Andreas Bießmann
2013-12-02 5:27 ` Bo Shen
2013-12-09 12:35 ` [U-Boot] [U-Boot,1/4] " Andreas Bießmann
2013-11-29 11:13 ` [U-Boot] [PATCH 2/4] at91: redefine legacy GPIO PIN_BASE Andreas Bießmann
2013-12-09 12:36 ` [U-Boot] [U-Boot,2/4] " Andreas Bießmann
2013-11-29 11:13 ` [U-Boot] [PATCH 3/4] at91: nand: switch atmel_nand to generic GPIO API Andreas Bießmann
2013-12-02 7:01 ` esw at bus-elektronik.de
2013-12-06 19:16 ` Scott Wood
2013-12-09 12:38 ` [U-Boot] [U-Boot,3/4] " Andreas Bießmann
2013-11-29 11:13 ` Andreas Bießmann [this message]
2013-12-09 12:38 ` [U-Boot] [U-Boot,4/4] at91: switch coloured LED to gpio API Andreas Bießmann
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=1385723626-1586-5-git-send-email-andreas.devel@googlemail.com \
--to=andreas.devel@googlemail.com \
--cc=u-boot@lists.denx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox