summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-realview/core.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2014-02-27 14:29:22 +0100
committerLinus Walleij <linus.walleij@linaro.org>2014-02-27 14:56:19 +0100
commite4ecf2bda239ddef5f4edd0e05d48bfdf88a475d (patch)
treecda31855444c116394cec653eef7ffbc833823b9 /arch/arm/mach-realview/core.c
parentd1cb3ecf327066137fb6245b13030cde60241dd6 (diff)
downloadlinux-e4ecf2bda239ddef5f4edd0e05d48bfdf88a475d.tar.bz2
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-realview/core.c')
-rw-r--r--arch/arm/mach-realview/core.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 1d5ee5c9a1dc..960b8dd78c44 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -148,6 +148,21 @@ struct platform_device realview_cf_device = {
},
};
+static struct resource realview_leds_resources[] = {
+ {
+ .start = REALVIEW_SYS_BASE + REALVIEW_SYS_LED_OFFSET,
+ .end = REALVIEW_SYS_BASE + REALVIEW_SYS_LED_OFFSET + 4,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+struct platform_device realview_leds_device = {
+ .name = "versatile-leds",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(realview_leds_resources),
+ .resource = realview_leds_resources,
+};
+
static struct resource realview_i2c_resource = {
.start = REALVIEW_I2C_BASE,
.end = REALVIEW_I2C_BASE + SZ_4K - 1,