summaryrefslogtreecommitdiff
path: root/arch/arm/mach-s3c2440
diff options
context:
space:
mode:
authorVasily Khoruzhick <anarsoul@gmail.com>2010-09-07 17:32:25 +0300
committerBen Dooks <ben-linux@fluff.org>2010-09-27 00:26:33 +0100
commit9c1a47cf1e8978394399198b6b296c10f3a8dbfe (patch)
tree74149d69c66be49832bc08bfbf09f38b3d88adea /arch/arm/mach-s3c2440
parentecab01d46c68370f347b2c1125cb90070813c799 (diff)
ARM: rx1950: Add LEDs support
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s3c2440')
-rw-r--r--arch/arm/mach-s3c2440/mach-rx1950.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2440/mach-rx1950.c b/arch/arm/mach-s3c2440/mach-rx1950.c
index a4d8c15da251..adfbb3046c86 100644
--- a/arch/arm/mach-s3c2440/mach-rx1950.c
+++ b/arch/arm/mach-s3c2440/mach-rx1950.c
@@ -29,6 +29,7 @@
#include <linux/pwm_backlight.h>
#include <linux/pwm.h>
#include <linux/s3c_adc_battery.h>
+#include <linux/leds.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
@@ -259,6 +260,37 @@ void rx1950_disable_charger(void)
gpio_direction_output(S3C2410_GPJ(3), 0);
}
+static struct gpio_led rx1950_leds_desc[] = {
+ {
+ .name = "Green",
+ .default_trigger = "main-battery-charging-or-full",
+ .gpio = S3C2410_GPA(6),
+ },
+ {
+ .name = "Red",
+ .default_trigger = "main-battery-full",
+ .gpio = S3C2410_GPA(7),
+ },
+ {
+ .name = "Blue",
+ .default_trigger = "rx1950-acx-mem",
+ .gpio = S3C2410_GPA(11),
+ },
+};
+
+static struct gpio_led_platform_data rx1950_leds_pdata = {
+ .num_leds = ARRAY_SIZE(rx1950_leds_desc),
+ .leds = rx1950_leds_desc,
+};
+
+static struct platform_device rx1950_leds = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &rx1950_leds_pdata,
+ },
+};
+
static struct s3c_adc_bat_pdata rx1950_bat_cfg = {
.init = rx1950_bat_init,
.exit = rx1950_bat_exit,
@@ -663,6 +695,7 @@ static struct platform_device *rx1950_devices[] __initdata = {
&rx1950_device_gpiokeys,
&power_supply,
&rx1950_battery,
+ &rx1950_leds,
};
static struct clk *rx1950_clocks[] __initdata = {