diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2010-11-30 01:52:18 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-12-01 01:54:58 -0500 |
commit | d44deb35c26c74d0f1ebea95a5fc386f72d210f7 (patch) | |
tree | 542d7d447cab1fd6ab45cf572e394e4d3ddcce27 /arch/arm/mach-shmobile/board-mackerel.c | |
parent | 25338f2e09fcbaa0470841c928bf0e718ca13382 (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/arm/mach-shmobile/board-mackerel.c')
-rw-r--r-- | arch/arm/mach-shmobile/board-mackerel.c | 40 |
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 @@ | |||
29 | #include <linux/gpio.h> | 29 | #include <linux/gpio.h> |
30 | #include <linux/input.h> | 30 | #include <linux/input.h> |
31 | #include <linux/io.h> | 31 | #include <linux/io.h> |
32 | #include <linux/leds.h> | ||
32 | #include <linux/mtd/mtd.h> | 33 | #include <linux/mtd/mtd.h> |
33 | #include <linux/mtd/partitions.h> | 34 | #include <linux/mtd/partitions.h> |
34 | #include <linux/mtd/physmap.h> | 35 | #include <linux/mtd/physmap.h> |
@@ -309,11 +310,50 @@ static struct platform_device usb1_host_device = { | |||
309 | .resource = usb1_host_resources, | 310 | .resource = usb1_host_resources, |
310 | }; | 311 | }; |
311 | 312 | ||
313 | /* LED */ | ||
314 | static struct gpio_led mackerel_leds[] = { | ||
315 | { | ||
316 | .name = "led0", | ||
317 | .gpio = GPIO_PORT0, | ||
318 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
319 | }, | ||
320 | { | ||
321 | .name = "led1", | ||
322 | .gpio = GPIO_PORT1, | ||
323 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
324 | }, | ||
325 | { | ||
326 | .name = "led2", | ||
327 | .gpio = GPIO_PORT2, | ||
328 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
329 | }, | ||
330 | { | ||
331 | .name = "led3", | ||
332 | .gpio = GPIO_PORT159, | ||
333 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
334 | } | ||
335 | }; | ||
336 | |||
337 | static struct gpio_led_platform_data mackerel_leds_pdata = { | ||
338 | .leds = mackerel_leds, | ||
339 | .num_leds = ARRAY_SIZE(mackerel_leds), | ||
340 | }; | ||
341 | |||
342 | static struct platform_device leds_device = { | ||
343 | .name = "leds-gpio", | ||
344 | .id = 0, | ||
345 | .dev = { | ||
346 | .platform_data = &mackerel_leds_pdata, | ||
347 | }, | ||
348 | }; | ||
349 | |||
350 | |||
312 | static struct platform_device *mackerel_devices[] __initdata = { | 351 | static struct platform_device *mackerel_devices[] __initdata = { |
313 | &nor_flash_device, | 352 | &nor_flash_device, |
314 | &smc911x_device, | 353 | &smc911x_device, |
315 | &lcdc_device, | 354 | &lcdc_device, |
316 | &usb1_host_device, | 355 | &usb1_host_device, |
356 | &leds_device, | ||
317 | }; | 357 | }; |
318 | 358 | ||
319 | static struct map_desc mackerel_io_desc[] __initdata = { | 359 | static struct map_desc mackerel_io_desc[] __initdata = { |