aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2009-09-24 19:20:02 +0200
committerLars-Peter Clausen <lars@metafoo.de>2009-12-06 09:53:57 +0100
commit423ca7950557104e1565df3efcb6f632002dd35f (patch)
tree22dc38dcff7717e03cf8c19c2a7d0b3b6ab89d03 /arch/arm
parent03e997d263d1d02dd7293e8467a9c01a7a3b81d1 (diff)
ARM: gta02: Add LED support
The gta02 has three leds which are connected though gpio pins and thus can get supported by using the generic leds-gpio driver. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-s3c2442/mach-gta02.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c
index 0f0c61912e6..f2eeba97bb8 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2442/mach-gta02.c
@@ -60,6 +60,8 @@
#include <linux/gpio_keys.h>
+#include <linux/leds.h>
+
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
@@ -583,6 +585,35 @@ static struct platform_device gta02_buttons_device = {
},
};
+/* LEDs */
+static struct gpio_led gta02_gpio_leds[] = {
+ {
+ .name = "gta02:orange:power",
+ .gpio = GTA02_GPIO_PWR_LED1,
+ },
+ {
+ .name = "gta02:blue:power",
+ .gpio = GTA02_GPIO_PWR_LED2,
+ },
+ {
+ .name = "gta02:red:aux",
+ .gpio = GTA02_GPIO_AUX_LED,
+ },
+};
+
+static struct gpio_led_platform_data gta02_gpio_leds_pdata = {
+ .leds = gta02_gpio_leds,
+ .num_leds = ARRAY_SIZE(gta02_gpio_leds),
+};
+
+static struct platform_device gta02_leds_device = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &gta02_gpio_leds_pdata,
+ },
+};
+
static void __init gta02_map_io(void)
{
s3c24xx_init_io(gta02_iodesc, ARRAY_SIZE(gta02_iodesc));
@@ -604,6 +635,7 @@ static struct platform_device *gta02_devices[] __initdata = {
&s3c_device_iis,
&s3c_device_i2c0,
&gta02_buttons_device,
+ &gta02_leds_device,
};
/* These guys DO need to be children of PMU. */