diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2009-09-24 19:20:02 +0200 |
---|---|---|
committer | Lars-Peter Clausen <lars@metafoo.de> | 2009-10-04 20:28:54 +0200 |
commit | 43c1f56e2af95cee6ca786b3d3a841dec80df3ed (patch) | |
tree | ee9a1a888f8c26a9ba685bde6dc66cb4419bebbd | |
parent | ccc13a3e1b488870b653cf935069b0cf4ac8085d (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>
-rw-r--r-- | arch/arm/mach-s3c2442/mach-gta02.c | 32 |
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..762937169d6 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-power:orange", + .gpio = GTA02_GPIO_PWR_LED1, + }, + { + .name = "gta02-power:blue", + .gpio = GTA02_GPIO_PWR_LED2, + }, + { + .name = "gta02-aux:red", + .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 = >a02_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, >a02_buttons_device, + >a02_leds_device, }; /* These guys DO need to be children of PMU. */ |