aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c64xx/mach-crag6410.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-29 04:05:29 -0500
committerKukjin Kim <kgene.kim@samsung.com>2012-01-19 19:39:36 -0500
commit66211f98d611056bf5fe918bbda37c636688574e (patch)
treee41552674103ca893909fe45e3cf8ddbfa6264c6 /arch/arm/mach-s3c64xx/mach-crag6410.c
parent84207d83adc9a9b97d45d9cefaaf0ca766891b92 (diff)
ARM: S3C64XX: Support GPIO LEDs on Cragganmore
Cragganmore has a bank of 8 LEDs connected to the memory mapped GPIO bank, mostly intended for low level diagnostics. Register these with the LED subsystem for runtime use. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s3c64xx/mach-crag6410.c')
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index 8077f650eb0e..9da2d78f12f2 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -19,6 +19,7 @@
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <linux/leds.h>
22#include <linux/delay.h> 23#include <linux/delay.h>
23#include <linux/regulator/machine.h> 24#include <linux/regulator/machine.h>
24#include <linux/regulator/fixed.h> 25#include <linux/regulator/fixed.h>
@@ -698,6 +699,54 @@ static struct s3c_sdhci_platdata crag6410_hsmmc0_pdata = {
698 .cfg_gpio = crag6410_cfg_sdhci0, 699 .cfg_gpio = crag6410_cfg_sdhci0,
699}; 700};
700 701
702static const struct gpio_led gpio_leds[] = {
703 {
704 .name = "d13:green:",
705 .gpio = MMGPIO_GPIO_BASE + 0,
706 .default_state = LEDS_GPIO_DEFSTATE_ON,
707 },
708 {
709 .name = "d14:green:",
710 .gpio = MMGPIO_GPIO_BASE + 1,
711 .default_state = LEDS_GPIO_DEFSTATE_ON,
712 },
713 {
714 .name = "d15:green:",
715 .gpio = MMGPIO_GPIO_BASE + 2,
716 .default_state = LEDS_GPIO_DEFSTATE_ON,
717 },
718 {
719 .name = "d16:green:",
720 .gpio = MMGPIO_GPIO_BASE + 3,
721 .default_state = LEDS_GPIO_DEFSTATE_ON,
722 },
723 {
724 .name = "d17:green:",
725 .gpio = MMGPIO_GPIO_BASE + 4,
726 .default_state = LEDS_GPIO_DEFSTATE_ON,
727 },
728 {
729 .name = "d18:green:",
730 .gpio = MMGPIO_GPIO_BASE + 5,
731 .default_state = LEDS_GPIO_DEFSTATE_ON,
732 },
733 {
734 .name = "d19:green:",
735 .gpio = MMGPIO_GPIO_BASE + 6,
736 .default_state = LEDS_GPIO_DEFSTATE_ON,
737 },
738 {
739 .name = "d20:green:",
740 .gpio = MMGPIO_GPIO_BASE + 7,
741 .default_state = LEDS_GPIO_DEFSTATE_ON,
742 },
743};
744
745static const struct gpio_led_platform_data gpio_leds_pdata = {
746 .leds = gpio_leds,
747 .num_leds = ARRAY_SIZE(gpio_leds),
748};
749
701static void __init crag6410_machine_init(void) 750static void __init crag6410_machine_init(void)
702{ 751{
703 /* Open drain IRQs need pullups */ 752 /* Open drain IRQs need pullups */
@@ -730,6 +779,8 @@ static void __init crag6410_machine_init(void)
730 779
731 platform_add_devices(crag6410_devices, ARRAY_SIZE(crag6410_devices)); 780 platform_add_devices(crag6410_devices, ARRAY_SIZE(crag6410_devices));
732 781
782 gpio_led_register_device(-1, &gpio_leds_pdata);
783
733 regulator_has_full_constraints(); 784 regulator_has_full_constraints();
734 785
735 s3c64xx_pm_init(); 786 s3c64xx_pm_init();