Merge tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[pandora-kernel.git] / arch / arm / mach-sa1100 / lart.c
index b775a0a..3048b17 100644 (file)
@@ -5,6 +5,9 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/tty.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/platform_device.h>
 
 #include <video/sa1100fb.h>
 
@@ -16,7 +19,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/serial_sa1100.h>
-#include <mach/mcp.h>
+#include <linux/platform_data/mfd-mcp-sa11x0.h>
 #include <mach/irqs.h>
 
 #include "generic.h"
@@ -126,6 +129,27 @@ static struct map_desc lart_io_desc[] __initdata = {
        }
 };
 
+/* LEDs */
+struct gpio_led lart_gpio_leds[] = {
+       {
+               .name                   = "lart:red",
+               .default_trigger        = "cpu0",
+               .gpio                   = 23,
+       },
+};
+
+static struct gpio_led_platform_data lart_gpio_led_info = {
+       .leds           = lart_gpio_leds,
+       .num_leds       = ARRAY_SIZE(lart_gpio_leds),
+};
+
+static struct platform_device lart_leds = {
+       .name   = "leds-gpio",
+       .id     = -1,
+       .dev    = {
+               .platform_data  = &lart_gpio_led_info,
+       }
+};
 static void __init lart_map_io(void)
 {
        sa1100_map_io();
@@ -139,6 +163,8 @@ static void __init lart_map_io(void)
        GPDR |= GPIO_UART_TXD;
        GPDR &= ~GPIO_UART_RXD;
        PPAR |= PPAR_UPR;
+
+       platform_device_register(&lart_leds);
 }
 
 MACHINE_START(LART, "LART")