]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: ARM: OMAP: LEDs driver support
authorKyungmin Park <kyungmin.park@samsung.com>
Fri, 4 Aug 2006 10:57:56 +0000 (13:57 +0300)
committerTony Lindgren <tony@atomide.com>
Fri, 4 Aug 2006 10:57:56 +0000 (13:57 +0300)
ARM: OMAP: LEDs driver support

OMAP GPIO LEDs support

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-apollon.c
drivers/leds/Kconfig
drivers/leds/Makefile
include/asm-arm/arch-omap/led.h [new file with mode: 0644]

index f30862e7d4923997928260b757f32ab5ddcb084f..3c8fde399782f56b44dbe86020dc42ea11ba4cd4 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/mtd/onenand.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
+#include <linux/leds.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
@@ -31,6 +32,7 @@
 #include <asm/mach/flash.h>
 
 #include <asm/arch/gpio.h>
+#include <asm/arch/led.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/usb.h>
 #include <asm/arch/board.h>
@@ -139,10 +141,45 @@ static struct platform_device apollon_lcd_device = {
        .id             = -1,
 };
 
+static struct omap_led_config apollon_led_config[] = {
+       {
+               .cdev   = {
+                       .name   = "apollon:led0",
+               },
+               .gpio   = LED0_GPIO13,
+       },
+       {
+               .cdev   = {
+                       .name   = "apollon:led1",
+               },
+               .gpio   = LED1_GPIO14,
+       },
+       {
+               .cdev   = {
+                       .name   = "apollon:led2",
+               },
+               .gpio   = LED2_GPIO15,
+       },
+};
+
+static struct omap_led_platform_data apollon_led_data = {
+       .nr_leds        = ARRAY_SIZE(apollon_led_config),
+       .leds           = apollon_led_config,
+};
+
+static struct platform_device apollon_led_device = {
+       .name           = "omap-led",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &apollon_led_data,
+       },
+};
+
 static struct platform_device *apollon_devices[] __initdata = {
        &apollon_onenand_device,
        &apollon_smc91x_device,
        &apollon_lcd_device,
+       &apollon_led_device,
 };
 
 static inline void __init apollon_init_smc91x(void)
index 03865e7a3c07d51fbc2ee57a7c7c51182e7f3d7e..be30bf643a5cb06100ae17f053fc572d47c3d9c7 100644 (file)
@@ -70,6 +70,12 @@ config LEDS_OMAP_PWM
          This options enables support for LEDs connected to GPIO lines
          controlled by a PWM timer on OMAP CPUs.
 
+config LEDS_OMAP
+       tristate "LED Support for OMAP GPIO LEDs"
+       depends LEDS_CLASS && ARCH_OMAP
+       help
+         This option enables support for the LEDs on OMAP processors.
+
 comment "LED Triggers"
 
 config LEDS_TRIGGERS
index fd7313191fc5750c2a9a14068a3b9447d3b2f55e..cd3dc5397a81f6a984411ad53ff31213c46cc7d7 100644 (file)
@@ -11,6 +11,7 @@ obj-$(CONFIG_LEDS_SPITZ)              += leds-spitz.o
 obj-$(CONFIG_LEDS_IXP4XX)              += leds-ixp4xx-gpio.o
 obj-$(CONFIG_LEDS_TOSA)                        += leds-tosa.o
 obj-$(CONFIG_LEDS_S3C24XX)             += leds-s3c24xx.o
+obj-$(CONFIG_LEDS_OMAP)                        += leds-omap.o
 obj-$(CONFIG_LEDS_OMAP_PWM)            += leds-omap-pwm.o
 
 # LED Triggers
diff --git a/include/asm-arm/arch-omap/led.h b/include/asm-arm/arch-omap/led.h
new file mode 100644 (file)
index 0000000..f3acae2
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ *  linux/include/asm-arm/arch-omap/led.h
+ *
+ *  Copyright (C) 2006 Samsung Electronics
+ *  Kyungmin Park <kyungmin.park@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef ASMARM_ARCH_LED_H
+#define ASMARM_ARCH_LED_H
+
+struct omap_led_config {
+       struct led_classdev     cdev;
+       s16                     gpio;
+};
+
+struct omap_led_platform_data {
+       s16                     nr_leds;
+       struct omap_led_config  *leds;
+};
+
+#endif