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

Commit 47e837b5 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Sascha Hauer
Browse files

ARM: imx: convert to new leds-gpio registration helper



This gets rid of per machine struct platform_device definitions and allows
to move the platform data and led definition to .init.rodata.

Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
parent 72370a5c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@ config MACH_EUKREA_MBIMXSD25_BASEBOARD
	bool "Eukrea MBIMXSD development board"
	select IMX_HAVE_PLATFORM_GPIO_KEYS
	select IMX_HAVE_PLATFORM_IMX_SSI
	select LEDS_GPIO_REGISTER
	help
	  This adds board specific devices that can be found on Eukrea's
	  MBIMXSD evaluation board.
@@ -265,6 +266,7 @@ config MACH_EUKREA_MBIMX27_BASEBOARD
	select IMX_HAVE_PLATFORM_IMX_UART
	select IMX_HAVE_PLATFORM_MXC_MMC
	select IMX_HAVE_PLATFORM_SPI_IMX
	select LEDS_GPIO_REGISTER
	help
	  This adds board specific devices that can be found on Eukrea's
	  MBIMX27 evaluation board.
@@ -403,6 +405,7 @@ config MACH_MX31LITE
	select IMX_HAVE_PLATFORM_MXC_NAND
	select IMX_HAVE_PLATFORM_MXC_RTC
	select IMX_HAVE_PLATFORM_SPI_IMX
	select LEDS_GPIO_REGISTER
	help
	  Include support for MX31 LITEKIT platform. This includes specific
	  configurations for the board and its peripherals.
@@ -471,6 +474,7 @@ config MACH_MX31MOBOARD
	select IMX_HAVE_PLATFORM_MXC_EHCI
	select IMX_HAVE_PLATFORM_MXC_MMC
	select IMX_HAVE_PLATFORM_SPI_IMX
	select LEDS_GPIO_REGISTER
	select MXC_ULPI if USB_ULPI
	help
	  Include support for mx31moboard platform. This includes specific
@@ -577,6 +581,7 @@ config MACH_EUKREA_MBIMXSD35_BASEBOARD
	select IMX_HAVE_PLATFORM_GPIO_KEYS
	select IMX_HAVE_PLATFORM_IMX_SSI
	select IMX_HAVE_PLATFORM_IPU_CORE
	select LEDS_GPIO_REGISTER
	help
	  This adds board specific devices that can be found on Eukrea's
	  MBIMXSD evaluation board.
+6 −17
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ eukrea_mbimx27_keymap_data __initconst = {
	.keymap_size    = ARRAY_SIZE(eukrea_mbimx27_keymap),
};

static struct gpio_led gpio_leds[] = {
static const struct gpio_led eukrea_mbimx27_gpio_leds[] __initconst = {
	{
		.name			= "led1",
		.default_trigger	= "heartbeat",
@@ -127,17 +127,10 @@ static struct gpio_led gpio_leds[] = {
	},
};

static struct gpio_led_platform_data gpio_led_info = {
	.leds		= gpio_leds,
	.num_leds	= ARRAY_SIZE(gpio_leds),
};

static struct platform_device leds_gpio = {
	.name	= "leds-gpio",
	.id	= -1,
	.dev	= {
		.platform_data	= &gpio_led_info,
	},
static const struct gpio_led_platform_data
		eukrea_mbimx27_gpio_led_info __initconst = {
	.leds		= eukrea_mbimx27_gpio_leds,
	.num_leds	= ARRAY_SIZE(eukrea_mbimx27_gpio_leds),
};

static struct imx_fb_videomode eukrea_mbimx27_modes[] = {
@@ -293,10 +286,6 @@ static struct i2c_board_info eukrea_mbimx27_i2c_devices[] = {
	},
};

static struct platform_device *platform_devices[] __initdata = {
	&leds_gpio,
};

static const struct imxmmc_platform_data sdhc_pdata __initconst = {
	.dat3_card_detect = 1,
};
@@ -377,5 +366,5 @@ void __init eukrea_mbimx27_baseboard_init(void)

	imx27_add_imx_keypad(&eukrea_mbimx27_keymap_data);

	platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
	gpio_led_register_device(-1, &eukrea_mbimx27_gpio_led_info);
}
+4 −11
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ static struct platform_device eukrea_mbimxsd_lcd_powerdev = {
	.dev.platform_data	= &eukrea_mbimxsd_lcd_power_data,
};

static struct gpio_led eukrea_mbimxsd_leds[] = {
static const struct gpio_led eukrea_mbimxsd_leds[] __initconst = {
	{
		.name			= "led1",
		.default_trigger	= "heartbeat",
@@ -182,19 +182,12 @@ static struct gpio_led eukrea_mbimxsd_leds[] = {
	},
};

static struct gpio_led_platform_data eukrea_mbimxsd_led_info = {
static const struct gpio_led_platform_data
		eukrea_mbimxsd_led_info __initconst = {
	.leds		= eukrea_mbimxsd_leds,
	.num_leds	= ARRAY_SIZE(eukrea_mbimxsd_leds),
};

static struct platform_device eukrea_mbimxsd_leds_gpio = {
	.name	= "leds-gpio",
	.id	= -1,
	.dev	= {
		.platform_data	= &eukrea_mbimxsd_led_info,
	},
};

static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = {
	{
		.gpio		= GPIO_SWITCH1,
@@ -212,7 +205,6 @@ static const struct gpio_keys_platform_data
};

static struct platform_device *platform_devices[] __initdata = {
	&eukrea_mbimxsd_leds_gpio,
	&eukrea_mbimxsd_lcd_powerdev,
};

@@ -287,5 +279,6 @@ void __init eukrea_mbimxsd25_baseboard_init(void)
				ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));

	platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
	gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
	imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
}
+3 −10
Original line number Diff line number Diff line
@@ -193,19 +193,12 @@ static struct gpio_led eukrea_mbimxsd_leds[] = {
	},
};

static struct gpio_led_platform_data eukrea_mbimxsd_led_info = {
static const struct gpio_led_platform_data
		eukrea_mbimxsd_led_info __initconst = {
	.leds		= eukrea_mbimxsd_leds,
	.num_leds	= ARRAY_SIZE(eukrea_mbimxsd_leds),
};

static struct platform_device eukrea_mbimxsd_leds_gpio = {
	.name	= "leds-gpio",
	.id	= -1,
	.dev	= {
		.platform_data	= &eukrea_mbimxsd_led_info,
	},
};

static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = {
	{
		.gpio		= GPIO_SWITCH1,
@@ -223,7 +216,6 @@ static const struct gpio_keys_platform_data
};

static struct platform_device *platform_devices[] __initdata = {
	&eukrea_mbimxsd_leds_gpio,
	&eukrea_mbimxsd_lcd_powerdev,
};

@@ -299,5 +291,6 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
				ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));

	platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
	gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
	imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
}
+3 −11
Original line number Diff line number Diff line
@@ -425,7 +425,7 @@ static int __init moboard_usbh2_init(void)
	return 0;
}

static struct gpio_led mx31moboard_leds[] = {
static const struct gpio_led mx31moboard_leds[] __initconst = {
	{
		.name	= "coreboard-led-0:red:running",
		.default_trigger = "heartbeat",
@@ -442,26 +442,17 @@ static struct gpio_led mx31moboard_leds[] = {
	},
};

static struct gpio_led_platform_data mx31moboard_led_pdata = {
static const struct gpio_led_platform_data mx31moboard_led_pdata __initconst = {
	.num_leds	= ARRAY_SIZE(mx31moboard_leds),
	.leds		= mx31moboard_leds,
};

static struct platform_device mx31moboard_leds_device = {
	.name	= "leds-gpio",
	.id	= -1,
	.dev	= {
		.platform_data = &mx31moboard_led_pdata,
	},
};

static const struct ipu_platform_data mx3_ipu_data __initconst = {
	.irq_base = MXC_IPU_IRQ_START,
};

static struct platform_device *devices[] __initdata = {
	&mx31moboard_flash,
	&mx31moboard_leds_device,
};

static struct mx3_camera_pdata camera_pdata __initdata = {
@@ -511,6 +502,7 @@ static void __init mx31moboard_init(void)
		"moboard");

	platform_add_devices(devices, ARRAY_SIZE(devices));
	gpio_led_register_device(-1, &mx31moboard_led_pdata);

	imx31_add_imx_uart0(&uart0_pdata);
	imx31_add_imx_uart4(&uart4_pdata);
Loading