[PATCH 5/7] eukrea_cpuimx25: add led support

Eric Bénard eric at eukrea.com
Fri Jan 7 11:35:31 EST 2011


Signed-off-by: Eric Bénard <eric at eukrea.com>
---
 arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
index 3048c3f..ce9be97 100644
--- a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
+++ b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
@@ -31,6 +31,7 @@
 #include <mach/gpio.h>
 #include <asm/io.h>
 #include <asm/mmu.h>
+#include <led.h>
 
 #include <partition.h>
 #include <generated/mach-types.h>
@@ -132,6 +133,11 @@ static struct imx_fb_platform_data eukrea_cpuimx25_fb_data = {
 	.dmacr		= 0x80040060,
 };
 
+struct gpio_led led0 = {
+	.gpio = 2 * 32 + 19,
+	.active_low = 1,
+};
+
 #ifdef CONFIG_USB
 static void imx25_usb_init(void)
 {
@@ -243,6 +249,8 @@ static struct pad_desc eukrea_cpuimx25_pads[] = {
 	MX25_PAD_SD1_DATA1__DAT1,
 	MX25_PAD_SD1_DATA2__DAT2,
 	MX25_PAD_SD1_DATA3__DAT3,
+	/* LED */
+	MX25_PAD_POWER_FAIL__GPIO19,
 };
 
 static int eukrea_cpuimx25_devices_init(void)
@@ -252,6 +260,8 @@ static int eukrea_cpuimx25_devices_init(void)
 	mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx25_pads,
 		ARRAY_SIZE(eukrea_cpuimx25_pads));
 
+	led_gpio_register(&led0);
+
 	imx25_add_fec(&fec_info);
 
 	nand_info.width = 1;
@@ -271,6 +281,9 @@ static int eukrea_cpuimx25_devices_init(void)
 	gpio_direction_output(26, 1);
 	gpio_set_value(26, 1);
 
+	/* LED : default OFF */
+	gpio_direction_output(2 * 32 + 19, 1);
+
 	imx25_add_fb(&eukrea_cpuimx25_fb_data);
 
 	imx25_add_i2c0(NULL);
-- 
1.7.3.4




More information about the barebox mailing list