summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2010-11-30 06:52:18 +0000
committerPaul Mundt <lethal@linux-sh.org>2010-12-01 15:54:58 +0900
commitd44deb35c26c74d0f1ebea95a5fc386f72d210f7 (patch)
tree542d7d447cab1fd6ab45cf572e394e4d3ddcce27 /arch
parent25338f2e09fcbaa0470841c928bf0e718ca13382 (diff)
ARM: mach-shmobile: mackerel: Add LEDs support
you can control it by echo 0 > /sys/class/leds/led0/brightness echo 1 > /sys/class/leds/led0/brightness Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index f9418e72900b..b9528b0211dc 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -29,6 +29,7 @@
#include <linux/gpio.h>
#include <linux/input.h>
#include <linux/io.h>
+#include <linux/leds.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
@@ -309,11 +310,50 @@ static struct platform_device usb1_host_device = {
.resource = usb1_host_resources,
};
+/* LED */
+static struct gpio_led mackerel_leds[] = {
+ {
+ .name = "led0",
+ .gpio = GPIO_PORT0,
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
+ },
+ {
+ .name = "led1",
+ .gpio = GPIO_PORT1,
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
+ },
+ {
+ .name = "led2",
+ .gpio = GPIO_PORT2,
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
+ },
+ {
+ .name = "led3",
+ .gpio = GPIO_PORT159,
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
+ }
+};
+
+static struct gpio_led_platform_data mackerel_leds_pdata = {
+ .leds = mackerel_leds,
+ .num_leds = ARRAY_SIZE(mackerel_leds),
+};
+
+static struct platform_device leds_device = {
+ .name = "leds-gpio",
+ .id = 0,
+ .dev = {
+ .platform_data = &mackerel_leds_pdata,
+ },
+};
+
+
static struct platform_device *mackerel_devices[] __initdata = {
&nor_flash_device,
&smc911x_device,
&lcdc_device,
&usb1_host_device,
+ &leds_device,
};
static struct map_desc mackerel_io_desc[] __initdata = {