Merge branch 'for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney...
[linux-2.6-block.git] / arch / arm / mach-omap1 / board-h3.c
index 86cb5a04a404e2ea3b8c89f5fb3051ab1d3583ec..1fa9c45c1ae591343e3d4ee4588fa01a34fcd21f 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/i2c/tps65010.h>
 #include <linux/smc91x.h>
 #include <linux/omapfb.h>
+#include <linux/leds.h>
 
 #include <asm/setup.h>
 #include <asm/page.h>
@@ -324,6 +325,32 @@ static struct spi_board_info h3_spi_board_info[] __initdata = {
        },
 };
 
+static struct gpio_led h3_gpio_led_pins[] = {
+       {
+               .name           = "h3:red",
+               .default_trigger = "heartbeat",
+               .gpio           = 3,
+       },
+       {
+               .name           = "h3:green",
+               .default_trigger = "cpu0",
+               .gpio           = OMAP_MPUIO(4),
+       },
+};
+
+static struct gpio_led_platform_data h3_gpio_led_data = {
+       .leds           = h3_gpio_led_pins,
+       .num_leds       = ARRAY_SIZE(h3_gpio_led_pins),
+};
+
+static struct platform_device h3_gpio_leds = {
+       .name   = "leds-gpio",
+       .id     = -1,
+       .dev    = {
+               .platform_data = &h3_gpio_led_data,
+       },
+};
+
 static struct platform_device *devices[] __initdata = {
        &nor_device,
        &nand_device,
@@ -331,6 +358,7 @@ static struct platform_device *devices[] __initdata = {
        &intlat_device,
        &h3_kp_device,
        &h3_lcd_device,
+       &h3_gpio_leds,
 };
 
 static struct omap_usb_config h3_usb_config __initdata = {
@@ -398,6 +426,10 @@ static void __init h3_init(void)
        omap_cfg_reg(E19_1610_KBR4);
        omap_cfg_reg(N19_1610_KBR5);
 
+       /* GPIO based LEDs */
+       omap_cfg_reg(P18_1610_GPIO3);
+       omap_cfg_reg(MPUIO4);
+
        smc91x_resources[1].start = gpio_to_irq(40);
        smc91x_resources[1].end = gpio_to_irq(40);
        platform_add_devices(devices, ARRAY_SIZE(devices));