Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4ecf2bd authored by Linus Walleij's avatar Linus Walleij
Browse files

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: default avatarLinus Walleij <linus.walleij@linaro.org>
parent d1cb3ecf
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -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,
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ struct machine_desc;

extern struct platform_device realview_flash_device;
extern struct platform_device realview_cf_device;
extern struct platform_device realview_leds_device;
extern struct platform_device realview_i2c_device;
extern struct mmci_platform_data realview_mmc0_plat_data;
extern struct mmci_platform_data realview_mmc1_plat_data;
+1 −0
Original line number Diff line number Diff line
@@ -452,6 +452,7 @@ static void __init realview_eb_init(void)
	realview_flash_register(&realview_eb_flash_resource, 1);
	platform_device_register(&realview_i2c_device);
	platform_device_register(&char_lcd_device);
	platform_device_register(&realview_leds_device);
	eth_device_register();
	realview_usb_register(realview_eb_isp1761_resources);

+1 −0
Original line number Diff line number Diff line
@@ -367,6 +367,7 @@ static void __init realview_pb1176_init(void)
	realview_usb_register(realview_pb1176_isp1761_resources);
	platform_device_register(&pmu_device);
	platform_device_register(&char_lcd_device);
	platform_device_register(&realview_leds_device);

	for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
		struct amba_device *d = amba_devs[i];
+1 −0
Original line number Diff line number Diff line
@@ -347,6 +347,7 @@ static void __init realview_pb11mp_init(void)
	realview_eth_register(NULL, realview_pb11mp_smsc911x_resources);
	platform_device_register(&realview_i2c_device);
	platform_device_register(&realview_cf_device);
	platform_device_register(&realview_leds_device);
	realview_usb_register(realview_pb11mp_isp1761_resources);
	platform_device_register(&pmu_device);

Loading