[PATCH 1/5] ARM scb9328: Add gpio led support

Sascha Hauer s.hauer at pengutronix.de
Tue Mar 8 06:39:41 EST 2011


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/boards/scb9328/scb9328.c |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boards/scb9328/scb9328.c b/arch/arm/boards/scb9328/scb9328.c
index 35c7fdf..a98d9fe 100644
--- a/arch/arm/boards/scb9328/scb9328.c
+++ b/arch/arm/boards/scb9328/scb9328.c
@@ -31,6 +31,7 @@
 #include <fs.h>
 #include <fcntl.h>
 #include <dm9000.h>
+#include <led.h>
 
 static struct device_d cfi_dev = {
 	.id	  = -1,
@@ -68,9 +69,30 @@ static struct device_d dm9000_dev = {
 	.platform_data = &dm9000_data,
 };
 
-static int scb9328_devices_init(void) {
+struct gpio_led leds[] = {
+	{
+		.gpio = 32 + 21,
+	}, {
+		.gpio = 32 + 22,
+	}, {
+		.gpio = 32 + 23,
+	}, {
+		.gpio = 32 + 24,
+	},
+};
+
+static int scb9328_devices_init(void)
+{
+	int i;
 
 	imx_gpio_mode(PA23_PF_CS5);
+	imx_gpio_mode(GPIO_PORTB | GPIO_GPIO | GPIO_OUT | 21);
+	imx_gpio_mode(GPIO_PORTB | GPIO_GPIO | GPIO_OUT | 22);
+	imx_gpio_mode(GPIO_PORTB | GPIO_GPIO | GPIO_OUT | 23);
+	imx_gpio_mode(GPIO_PORTB | GPIO_GPIO | GPIO_OUT | 24);
+
+	for (i = 0; i < ARRAY_SIZE(leds); i++)
+		led_gpio_register(&leds[i]);
 
 /* CS3 becomes CS3 by clearing reset default bit 1 in FMCR */
 	FMCR = 0x1;
-- 
1.7.2.3




More information about the barebox mailing list