aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ep93xx
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-04-11 18:44:42 -0400
committerRyan Mallon <rmallon@gmail.com>2012-04-11 19:38:15 -0400
commita1eacd79a602707f97201edbac9a03edaaea1847 (patch)
tree5a2aa3be94a38878d2f6d4d88d62523ace0c2245 /arch/arm/mach-ep93xx
parent011b2e84582ba873f63f2c42829f1677782b5cfe (diff)
arm: ep93xx: use gpio_led_register_device
Use gpio_led_register_device to register the two leds connected to the ep93xx. Since this is a common feature for all ep93xx based boards, create a new Kconfig option, EP93XX_SOC_COMMON, to select the LEDS_GPIO_REGISTER feature. The struct gpio_led and struct gpio_led_platform_data variables have been changed to const struct because of: commit 9517f925f2eb9ffca78b3f0f9389fc675bcb572c leds: make *struct gpio_led_platform_data.leds const They have also been marked as __initconst because the helper function gpio_led_register_device makes a deep copy of the platform data to allow it to live in init memory: commit 4440673a95e63ad888a41db596edaa0c55d3a332 leds: provide helper to register "leds-gpio" devices Signed-off-by: Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Ryan Mallon <rmallon@gmail.com>
Diffstat (limited to 'arch/arm/mach-ep93xx')
-rw-r--r--arch/arm/mach-ep93xx/Kconfig5
-rw-r--r--arch/arm/mach-ep93xx/core.c16
2 files changed, 9 insertions, 12 deletions
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 97a249395b5a..fe3c1fa5462b 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -2,6 +2,11 @@ if ARCH_EP93XX
2 2
3menu "Cirrus EP93xx Implementation Options" 3menu "Cirrus EP93xx Implementation Options"
4 4
5config EP93XX_SOC_COMMON
6 bool
7 default y
8 select LEDS_GPIO_REGISTER
9
5config CRUNCH 10config CRUNCH
6 bool "Support for MaverickCrunch" 11 bool "Support for MaverickCrunch"
7 help 12 help
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index e4a64d2f8955..66b1494f23a6 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -482,7 +482,7 @@ void __init ep93xx_register_spi(struct ep93xx_spi_info *info,
482/************************************************************************* 482/*************************************************************************
483 * EP93xx LEDs 483 * EP93xx LEDs
484 *************************************************************************/ 484 *************************************************************************/
485static struct gpio_led ep93xx_led_pins[] = { 485static const struct gpio_led ep93xx_led_pins[] __initconst = {
486 { 486 {
487 .name = "platform:grled", 487 .name = "platform:grled",
488 .gpio = EP93XX_GPIO_LINE_GRLED, 488 .gpio = EP93XX_GPIO_LINE_GRLED,
@@ -492,20 +492,11 @@ static struct gpio_led ep93xx_led_pins[] = {
492 }, 492 },
493}; 493};
494 494
495static struct gpio_led_platform_data ep93xx_led_data = { 495static const struct gpio_led_platform_data ep93xx_led_data __initconst = {
496 .num_leds = ARRAY_SIZE(ep93xx_led_pins), 496 .num_leds = ARRAY_SIZE(ep93xx_led_pins),
497 .leds = ep93xx_led_pins, 497 .leds = ep93xx_led_pins,
498}; 498};
499 499
500static struct platform_device ep93xx_leds = {
501 .name = "leds-gpio",
502 .id = -1,
503 .dev = {
504 .platform_data = &ep93xx_led_data,
505 },
506};
507
508
509/************************************************************************* 500/*************************************************************************
510 * EP93xx pwm peripheral handling 501 * EP93xx pwm peripheral handling
511 *************************************************************************/ 502 *************************************************************************/
@@ -827,8 +818,9 @@ void __init ep93xx_init_devices(void)
827 818
828 platform_device_register(&ep93xx_rtc_device); 819 platform_device_register(&ep93xx_rtc_device);
829 platform_device_register(&ep93xx_ohci_device); 820 platform_device_register(&ep93xx_ohci_device);
830 platform_device_register(&ep93xx_leds);
831 platform_device_register(&ep93xx_wdt_device); 821 platform_device_register(&ep93xx_wdt_device);
822
823 gpio_led_register_device(-1, &ep93xx_led_data);
832} 824}
833 825
834void ep93xx_restart(char mode, const char *cmd) 826void ep93xx_restart(char mode, const char *cmd)