diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2011-05-28 15:05:01 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-07-07 03:59:57 -0400 |
commit | 47e837b54c01083ce153493882fb8d74d108ae4a (patch) | |
tree | 96a8da262c733a4e926993653a9dcf5e80387135 /arch | |
parent | 72370a5cc28f9efc94a4d7d7dff2ebcb76139088 (diff) |
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: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx31moboard.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-imx/mx31lite-db.c | 15 |
6 files changed, 25 insertions, 60 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 59c97a33113..e8dd22fa7d6 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
@@ -167,6 +167,7 @@ config MACH_EUKREA_MBIMXSD25_BASEBOARD | |||
167 | bool "Eukrea MBIMXSD development board" | 167 | bool "Eukrea MBIMXSD development board" |
168 | select IMX_HAVE_PLATFORM_GPIO_KEYS | 168 | select IMX_HAVE_PLATFORM_GPIO_KEYS |
169 | select IMX_HAVE_PLATFORM_IMX_SSI | 169 | select IMX_HAVE_PLATFORM_IMX_SSI |
170 | select LEDS_GPIO_REGISTER | ||
170 | help | 171 | help |
171 | This adds board specific devices that can be found on Eukrea's | 172 | This adds board specific devices that can be found on Eukrea's |
172 | MBIMXSD evaluation board. | 173 | MBIMXSD evaluation board. |
@@ -265,6 +266,7 @@ config MACH_EUKREA_MBIMX27_BASEBOARD | |||
265 | select IMX_HAVE_PLATFORM_IMX_UART | 266 | select IMX_HAVE_PLATFORM_IMX_UART |
266 | select IMX_HAVE_PLATFORM_MXC_MMC | 267 | select IMX_HAVE_PLATFORM_MXC_MMC |
267 | select IMX_HAVE_PLATFORM_SPI_IMX | 268 | select IMX_HAVE_PLATFORM_SPI_IMX |
269 | select LEDS_GPIO_REGISTER | ||
268 | help | 270 | help |
269 | This adds board specific devices that can be found on Eukrea's | 271 | This adds board specific devices that can be found on Eukrea's |
270 | MBIMX27 evaluation board. | 272 | MBIMX27 evaluation board. |
@@ -403,6 +405,7 @@ config MACH_MX31LITE | |||
403 | select IMX_HAVE_PLATFORM_MXC_NAND | 405 | select IMX_HAVE_PLATFORM_MXC_NAND |
404 | select IMX_HAVE_PLATFORM_MXC_RTC | 406 | select IMX_HAVE_PLATFORM_MXC_RTC |
405 | select IMX_HAVE_PLATFORM_SPI_IMX | 407 | select IMX_HAVE_PLATFORM_SPI_IMX |
408 | select LEDS_GPIO_REGISTER | ||
406 | help | 409 | help |
407 | Include support for MX31 LITEKIT platform. This includes specific | 410 | Include support for MX31 LITEKIT platform. This includes specific |
408 | configurations for the board and its peripherals. | 411 | configurations for the board and its peripherals. |
@@ -471,6 +474,7 @@ config MACH_MX31MOBOARD | |||
471 | select IMX_HAVE_PLATFORM_MXC_EHCI | 474 | select IMX_HAVE_PLATFORM_MXC_EHCI |
472 | select IMX_HAVE_PLATFORM_MXC_MMC | 475 | select IMX_HAVE_PLATFORM_MXC_MMC |
473 | select IMX_HAVE_PLATFORM_SPI_IMX | 476 | select IMX_HAVE_PLATFORM_SPI_IMX |
477 | select LEDS_GPIO_REGISTER | ||
474 | select MXC_ULPI if USB_ULPI | 478 | select MXC_ULPI if USB_ULPI |
475 | help | 479 | help |
476 | Include support for mx31moboard platform. This includes specific | 480 | Include support for mx31moboard platform. This includes specific |
@@ -577,6 +581,7 @@ config MACH_EUKREA_MBIMXSD35_BASEBOARD | |||
577 | select IMX_HAVE_PLATFORM_GPIO_KEYS | 581 | select IMX_HAVE_PLATFORM_GPIO_KEYS |
578 | select IMX_HAVE_PLATFORM_IMX_SSI | 582 | select IMX_HAVE_PLATFORM_IMX_SSI |
579 | select IMX_HAVE_PLATFORM_IPU_CORE | 583 | select IMX_HAVE_PLATFORM_IPU_CORE |
584 | select LEDS_GPIO_REGISTER | ||
580 | help | 585 | help |
581 | This adds board specific devices that can be found on Eukrea's | 586 | This adds board specific devices that can be found on Eukrea's |
582 | MBIMXSD evaluation board. | 587 | MBIMXSD evaluation board. |
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c index 5911281da5f..5db3e1463af 100644 --- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | |||
@@ -112,7 +112,7 @@ eukrea_mbimx27_keymap_data __initconst = { | |||
112 | .keymap_size = ARRAY_SIZE(eukrea_mbimx27_keymap), | 112 | .keymap_size = ARRAY_SIZE(eukrea_mbimx27_keymap), |
113 | }; | 113 | }; |
114 | 114 | ||
115 | static struct gpio_led gpio_leds[] = { | 115 | static const struct gpio_led eukrea_mbimx27_gpio_leds[] __initconst = { |
116 | { | 116 | { |
117 | .name = "led1", | 117 | .name = "led1", |
118 | .default_trigger = "heartbeat", | 118 | .default_trigger = "heartbeat", |
@@ -127,17 +127,10 @@ static struct gpio_led gpio_leds[] = { | |||
127 | }, | 127 | }, |
128 | }; | 128 | }; |
129 | 129 | ||
130 | static struct gpio_led_platform_data gpio_led_info = { | 130 | static const struct gpio_led_platform_data |
131 | .leds = gpio_leds, | 131 | eukrea_mbimx27_gpio_led_info __initconst = { |
132 | .num_leds = ARRAY_SIZE(gpio_leds), | 132 | .leds = eukrea_mbimx27_gpio_leds, |
133 | }; | 133 | .num_leds = ARRAY_SIZE(eukrea_mbimx27_gpio_leds), |
134 | |||
135 | static struct platform_device leds_gpio = { | ||
136 | .name = "leds-gpio", | ||
137 | .id = -1, | ||
138 | .dev = { | ||
139 | .platform_data = &gpio_led_info, | ||
140 | }, | ||
141 | }; | 134 | }; |
142 | 135 | ||
143 | static struct imx_fb_videomode eukrea_mbimx27_modes[] = { | 136 | static struct imx_fb_videomode eukrea_mbimx27_modes[] = { |
@@ -293,10 +286,6 @@ static struct i2c_board_info eukrea_mbimx27_i2c_devices[] = { | |||
293 | }, | 286 | }, |
294 | }; | 287 | }; |
295 | 288 | ||
296 | static struct platform_device *platform_devices[] __initdata = { | ||
297 | &leds_gpio, | ||
298 | }; | ||
299 | |||
300 | static const struct imxmmc_platform_data sdhc_pdata __initconst = { | 289 | static const struct imxmmc_platform_data sdhc_pdata __initconst = { |
301 | .dat3_card_detect = 1, | 290 | .dat3_card_detect = 1, |
302 | }; | 291 | }; |
@@ -377,5 +366,5 @@ void __init eukrea_mbimx27_baseboard_init(void) | |||
377 | 366 | ||
378 | imx27_add_imx_keypad(&eukrea_mbimx27_keymap_data); | 367 | imx27_add_imx_keypad(&eukrea_mbimx27_keymap_data); |
379 | 368 | ||
380 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 369 | gpio_led_register_device(-1, &eukrea_mbimx27_gpio_led_info); |
381 | } | 370 | } |
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c index f9ef04acdab..01ebcb31e48 100644 --- a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c | |||
@@ -173,7 +173,7 @@ static struct platform_device eukrea_mbimxsd_lcd_powerdev = { | |||
173 | .dev.platform_data = &eukrea_mbimxsd_lcd_power_data, | 173 | .dev.platform_data = &eukrea_mbimxsd_lcd_power_data, |
174 | }; | 174 | }; |
175 | 175 | ||
176 | static struct gpio_led eukrea_mbimxsd_leds[] = { | 176 | static const struct gpio_led eukrea_mbimxsd_leds[] __initconst = { |
177 | { | 177 | { |
178 | .name = "led1", | 178 | .name = "led1", |
179 | .default_trigger = "heartbeat", | 179 | .default_trigger = "heartbeat", |
@@ -182,19 +182,12 @@ static struct gpio_led eukrea_mbimxsd_leds[] = { | |||
182 | }, | 182 | }, |
183 | }; | 183 | }; |
184 | 184 | ||
185 | static struct gpio_led_platform_data eukrea_mbimxsd_led_info = { | 185 | static const struct gpio_led_platform_data |
186 | eukrea_mbimxsd_led_info __initconst = { | ||
186 | .leds = eukrea_mbimxsd_leds, | 187 | .leds = eukrea_mbimxsd_leds, |
187 | .num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds), | 188 | .num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds), |
188 | }; | 189 | }; |
189 | 190 | ||
190 | static struct platform_device eukrea_mbimxsd_leds_gpio = { | ||
191 | .name = "leds-gpio", | ||
192 | .id = -1, | ||
193 | .dev = { | ||
194 | .platform_data = &eukrea_mbimxsd_led_info, | ||
195 | }, | ||
196 | }; | ||
197 | |||
198 | static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = { | 191 | static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = { |
199 | { | 192 | { |
200 | .gpio = GPIO_SWITCH1, | 193 | .gpio = GPIO_SWITCH1, |
@@ -212,7 +205,6 @@ static const struct gpio_keys_platform_data | |||
212 | }; | 205 | }; |
213 | 206 | ||
214 | static struct platform_device *platform_devices[] __initdata = { | 207 | static struct platform_device *platform_devices[] __initdata = { |
215 | &eukrea_mbimxsd_leds_gpio, | ||
216 | &eukrea_mbimxsd_lcd_powerdev, | 208 | &eukrea_mbimxsd_lcd_powerdev, |
217 | }; | 209 | }; |
218 | 210 | ||
@@ -287,5 +279,6 @@ void __init eukrea_mbimxsd25_baseboard_init(void) | |||
287 | ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); | 279 | ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); |
288 | 280 | ||
289 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 281 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
282 | gpio_led_register_device(-1, &eukrea_mbimxsd_led_info); | ||
290 | imx_add_gpio_keys(&eukrea_mbimxsd_button_data); | 283 | imx_add_gpio_keys(&eukrea_mbimxsd_button_data); |
291 | } | 284 | } |
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c index 4909ea05855..558eb526ba5 100644 --- a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c | |||
@@ -193,19 +193,12 @@ static struct gpio_led eukrea_mbimxsd_leds[] = { | |||
193 | }, | 193 | }, |
194 | }; | 194 | }; |
195 | 195 | ||
196 | static struct gpio_led_platform_data eukrea_mbimxsd_led_info = { | 196 | static const struct gpio_led_platform_data |
197 | eukrea_mbimxsd_led_info __initconst = { | ||
197 | .leds = eukrea_mbimxsd_leds, | 198 | .leds = eukrea_mbimxsd_leds, |
198 | .num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds), | 199 | .num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds), |
199 | }; | 200 | }; |
200 | 201 | ||
201 | static struct platform_device eukrea_mbimxsd_leds_gpio = { | ||
202 | .name = "leds-gpio", | ||
203 | .id = -1, | ||
204 | .dev = { | ||
205 | .platform_data = &eukrea_mbimxsd_led_info, | ||
206 | }, | ||
207 | }; | ||
208 | |||
209 | static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = { | 202 | static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = { |
210 | { | 203 | { |
211 | .gpio = GPIO_SWITCH1, | 204 | .gpio = GPIO_SWITCH1, |
@@ -223,7 +216,6 @@ static const struct gpio_keys_platform_data | |||
223 | }; | 216 | }; |
224 | 217 | ||
225 | static struct platform_device *platform_devices[] __initdata = { | 218 | static struct platform_device *platform_devices[] __initdata = { |
226 | &eukrea_mbimxsd_leds_gpio, | ||
227 | &eukrea_mbimxsd_lcd_powerdev, | 219 | &eukrea_mbimxsd_lcd_powerdev, |
228 | }; | 220 | }; |
229 | 221 | ||
@@ -299,5 +291,6 @@ void __init eukrea_mbimxsd35_baseboard_init(void) | |||
299 | ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); | 291 | ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); |
300 | 292 | ||
301 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 293 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
294 | gpio_led_register_device(-1, &eukrea_mbimxsd_led_info); | ||
302 | imx_add_gpio_keys(&eukrea_mbimxsd_button_data); | 295 | imx_add_gpio_keys(&eukrea_mbimxsd_button_data); |
303 | } | 296 | } |
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c index eaa51e49ca9..abe688b3297 100644 --- a/arch/arm/mach-imx/mach-mx31moboard.c +++ b/arch/arm/mach-imx/mach-mx31moboard.c | |||
@@ -425,7 +425,7 @@ static int __init moboard_usbh2_init(void) | |||
425 | return 0; | 425 | return 0; |
426 | } | 426 | } |
427 | 427 | ||
428 | static struct gpio_led mx31moboard_leds[] = { | 428 | static const struct gpio_led mx31moboard_leds[] __initconst = { |
429 | { | 429 | { |
430 | .name = "coreboard-led-0:red:running", | 430 | .name = "coreboard-led-0:red:running", |
431 | .default_trigger = "heartbeat", | 431 | .default_trigger = "heartbeat", |
@@ -442,26 +442,17 @@ static struct gpio_led mx31moboard_leds[] = { | |||
442 | }, | 442 | }, |
443 | }; | 443 | }; |
444 | 444 | ||
445 | static struct gpio_led_platform_data mx31moboard_led_pdata = { | 445 | static const struct gpio_led_platform_data mx31moboard_led_pdata __initconst = { |
446 | .num_leds = ARRAY_SIZE(mx31moboard_leds), | 446 | .num_leds = ARRAY_SIZE(mx31moboard_leds), |
447 | .leds = mx31moboard_leds, | 447 | .leds = mx31moboard_leds, |
448 | }; | 448 | }; |
449 | 449 | ||
450 | static struct platform_device mx31moboard_leds_device = { | ||
451 | .name = "leds-gpio", | ||
452 | .id = -1, | ||
453 | .dev = { | ||
454 | .platform_data = &mx31moboard_led_pdata, | ||
455 | }, | ||
456 | }; | ||
457 | |||
458 | static const struct ipu_platform_data mx3_ipu_data __initconst = { | 450 | static const struct ipu_platform_data mx3_ipu_data __initconst = { |
459 | .irq_base = MXC_IPU_IRQ_START, | 451 | .irq_base = MXC_IPU_IRQ_START, |
460 | }; | 452 | }; |
461 | 453 | ||
462 | static struct platform_device *devices[] __initdata = { | 454 | static struct platform_device *devices[] __initdata = { |
463 | &mx31moboard_flash, | 455 | &mx31moboard_flash, |
464 | &mx31moboard_leds_device, | ||
465 | }; | 456 | }; |
466 | 457 | ||
467 | static struct mx3_camera_pdata camera_pdata __initdata = { | 458 | static struct mx3_camera_pdata camera_pdata __initdata = { |
@@ -511,6 +502,7 @@ static void __init mx31moboard_init(void) | |||
511 | "moboard"); | 502 | "moboard"); |
512 | 503 | ||
513 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 504 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
505 | gpio_led_register_device(-1, &mx31moboard_led_pdata); | ||
514 | 506 | ||
515 | imx31_add_imx_uart0(&uart0_pdata); | 507 | imx31_add_imx_uart0(&uart0_pdata); |
516 | imx31_add_imx_uart4(&uart4_pdata); | 508 | imx31_add_imx_uart4(&uart4_pdata); |
diff --git a/arch/arm/mach-imx/mx31lite-db.c b/arch/arm/mach-imx/mx31lite-db.c index 5aa053edc17..bf0fb87946b 100644 --- a/arch/arm/mach-imx/mx31lite-db.c +++ b/arch/arm/mach-imx/mx31lite-db.c | |||
@@ -161,7 +161,7 @@ static const struct spi_imx_master spi0_pdata __initconst = { | |||
161 | 161 | ||
162 | /* GPIO LEDs */ | 162 | /* GPIO LEDs */ |
163 | 163 | ||
164 | static struct gpio_led litekit_leds[] = { | 164 | static const struct gpio_led litekit_leds[] __initconst = { |
165 | { | 165 | { |
166 | .name = "GPIO0", | 166 | .name = "GPIO0", |
167 | .gpio = IOMUX_TO_GPIO(MX31_PIN_COMPARE), | 167 | .gpio = IOMUX_TO_GPIO(MX31_PIN_COMPARE), |
@@ -176,19 +176,12 @@ static struct gpio_led litekit_leds[] = { | |||
176 | } | 176 | } |
177 | }; | 177 | }; |
178 | 178 | ||
179 | static struct gpio_led_platform_data litekit_led_platform_data = { | 179 | static const struct gpio_led_platform_data |
180 | litekit_led_platform_data __initconst = { | ||
180 | .leds = litekit_leds, | 181 | .leds = litekit_leds, |
181 | .num_leds = ARRAY_SIZE(litekit_leds), | 182 | .num_leds = ARRAY_SIZE(litekit_leds), |
182 | }; | 183 | }; |
183 | 184 | ||
184 | static struct platform_device litekit_led_device = { | ||
185 | .name = "leds-gpio", | ||
186 | .id = -1, | ||
187 | .dev = { | ||
188 | .platform_data = &litekit_led_platform_data, | ||
189 | }, | ||
190 | }; | ||
191 | |||
192 | void __init mx31lite_db_init(void) | 185 | void __init mx31lite_db_init(void) |
193 | { | 186 | { |
194 | mxc_iomux_setup_multiple_pins(litekit_db_board_pins, | 187 | mxc_iomux_setup_multiple_pins(litekit_db_board_pins, |
@@ -197,7 +190,7 @@ void __init mx31lite_db_init(void) | |||
197 | imx31_add_imx_uart0(&uart_pdata); | 190 | imx31_add_imx_uart0(&uart_pdata); |
198 | imx31_add_mxc_mmc(0, &mmc_pdata); | 191 | imx31_add_mxc_mmc(0, &mmc_pdata); |
199 | imx31_add_spi_imx0(&spi0_pdata); | 192 | imx31_add_spi_imx0(&spi0_pdata); |
200 | platform_device_register(&litekit_led_device); | 193 | gpio_led_register_device(-1, &litekit_led_platform_data); |
201 | imx31_add_imx2_wdt(NULL); | 194 | imx31_add_imx2_wdt(NULL); |
202 | imx31_add_mxc_rtc(NULL); | 195 | imx31_add_mxc_rtc(NULL); |
203 | } | 196 | } |