aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-versatile
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2014-02-27 08:29:22 -0500
committerLinus Walleij <linus.walleij@linaro.org>2014-02-27 08:56:19 -0500
commite4ecf2bda239ddef5f4edd0e05d48bfdf88a475d (patch)
treecda31855444c116394cec653eef7ffbc833823b9 /arch/arm/mach-versatile
parentd1cb3ecf327066137fb6245b13030cde60241dd6 (diff)
ARM: plat-versatile: convert LEDs to platform device
The LEDs were initialized unconditionally with an fs_initcall() which doesn't play well with multiplatform. Convert the driver to a platform device and convert all boards with these LEDs to register a platform device and pass the register as a resource instead. Tested successfully on the Versatile/AB and RealView PB1176. Cc: Bryan Wu <cooloney@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Russell King <linux@arm.linux.org.uk> Cc: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-versatile')
-rw-r--r--arch/arm/mach-versatile/core.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index a335126ae18f..b31878570a00 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -310,6 +310,21 @@ static struct platform_device char_lcd_device = {
310 .resource = char_lcd_resources, 310 .resource = char_lcd_resources,
311}; 311};
312 312
313static struct resource leds_resources[] = {
314 {
315 .start = VERSATILE_SYS_BASE + VERSATILE_SYS_LED_OFFSET,
316 .end = VERSATILE_SYS_BASE + VERSATILE_SYS_LED_OFFSET + 4,
317 .flags = IORESOURCE_MEM,
318 },
319};
320
321static struct platform_device leds_device = {
322 .name = "versatile-leds",
323 .id = -1,
324 .num_resources = ARRAY_SIZE(leds_resources),
325 .resource = leds_resources,
326};
327
313/* 328/*
314 * Clock handling 329 * Clock handling
315 */ 330 */
@@ -795,6 +810,7 @@ void __init versatile_init(void)
795 platform_device_register(&versatile_i2c_device); 810 platform_device_register(&versatile_i2c_device);
796 platform_device_register(&smc91x_device); 811 platform_device_register(&smc91x_device);
797 platform_device_register(&char_lcd_device); 812 platform_device_register(&char_lcd_device);
813 platform_device_register(&leds_device);
798 814
799 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 815 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
800 struct amba_device *d = amba_devs[i]; 816 struct amba_device *d = amba_devs[i];