diff options
author | Vladimir Zapolskiy <vz@mleia.com> | 2016-09-18 21:37:24 -0400 |
---|---|---|
committer | Shawn Guo <shawnguo@kernel.org> | 2016-09-20 10:35:20 -0400 |
commit | 88b074626fe1931ddbfc22c60ef183514a29365b (patch) | |
tree | 5b8f9cc9f46f662e9c8362d6ea2492b49486f045 | |
parent | 598b2505b1b960e49ab050d61804566716818a6d (diff) |
ARM: imx legacy: mx27-3ds: move peripheral initialization to .init_late
The change moves some of peripheral registrations and initializations
(all peripherals dependent on GPIOs) from .init_machine to .init_late
level, this allows to safely shift the shared GPIO controller driver
initialization level after init level of i.MX IOMUXC driver.
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
-rw-r--r-- | arch/arm/mach-imx/mach-mx27_3ds.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c index 9ef4640f3660..7ba651a9b5b8 100644 --- a/arch/arm/mach-imx/mach-mx27_3ds.c +++ b/arch/arm/mach-imx/mach-mx27_3ds.c | |||
@@ -485,17 +485,32 @@ static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = { | |||
485 | 485 | ||
486 | static void __init mx27pdk_init(void) | 486 | static void __init mx27pdk_init(void) |
487 | { | 487 | { |
488 | int ret; | ||
489 | imx27_soc_init(); | 488 | imx27_soc_init(); |
490 | 489 | ||
491 | mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins), | 490 | mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins), |
492 | "mx27pdk"); | 491 | "mx27pdk"); |
493 | mx27_3ds_sdhc1_enable_level_translator(); | ||
494 | imx27_add_imx_uart0(&uart_pdata); | 492 | imx27_add_imx_uart0(&uart_pdata); |
495 | imx27_add_fec(NULL); | 493 | imx27_add_fec(NULL); |
496 | imx27_add_imx_keypad(&mx27_3ds_keymap_data); | 494 | imx27_add_imx_keypad(&mx27_3ds_keymap_data); |
497 | imx27_add_mxc_mmc(0, &sdhc1_pdata); | ||
498 | imx27_add_imx2_wdt(); | 495 | imx27_add_imx2_wdt(); |
496 | |||
497 | imx27_add_spi_imx1(&spi2_pdata); | ||
498 | imx27_add_spi_imx0(&spi1_pdata); | ||
499 | |||
500 | imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data); | ||
501 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
502 | imx27_add_imx_fb(&mx27_3ds_fb_data); | ||
503 | |||
504 | imx27_add_imx_ssi(0, &mx27_3ds_ssi_pdata); | ||
505 | } | ||
506 | |||
507 | static void __init mx27pdk_late_init(void) | ||
508 | { | ||
509 | int ret; | ||
510 | |||
511 | mx27_3ds_sdhc1_enable_level_translator(); | ||
512 | imx27_add_mxc_mmc(0, &sdhc1_pdata); | ||
513 | |||
499 | otg_phy_init(); | 514 | otg_phy_init(); |
500 | 515 | ||
501 | if (otg_mode_host) { | 516 | if (otg_mode_host) { |
@@ -509,17 +524,12 @@ static void __init mx27pdk_init(void) | |||
509 | if (!otg_mode_host) | 524 | if (!otg_mode_host) |
510 | imx27_add_fsl_usb2_udc(&otg_device_pdata); | 525 | imx27_add_fsl_usb2_udc(&otg_device_pdata); |
511 | 526 | ||
512 | imx27_add_spi_imx1(&spi2_pdata); | ||
513 | imx27_add_spi_imx0(&spi1_pdata); | ||
514 | mx27_3ds_spi_devs[0].irq = gpio_to_irq(PMIC_INT); | 527 | mx27_3ds_spi_devs[0].irq = gpio_to_irq(PMIC_INT); |
515 | spi_register_board_info(mx27_3ds_spi_devs, | 528 | spi_register_board_info(mx27_3ds_spi_devs, |
516 | ARRAY_SIZE(mx27_3ds_spi_devs)); | 529 | ARRAY_SIZE(mx27_3ds_spi_devs)); |
517 | 530 | ||
518 | if (mxc_expio_init(MX27_CS5_BASE_ADDR, IMX_GPIO_NR(3, 28))) | 531 | if (mxc_expio_init(MX27_CS5_BASE_ADDR, IMX_GPIO_NR(3, 28))) |
519 | pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n"); | 532 | pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n"); |
520 | imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data); | ||
521 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
522 | imx27_add_imx_fb(&mx27_3ds_fb_data); | ||
523 | 533 | ||
524 | ret = gpio_request_array(mx27_3ds_camera_gpios, | 534 | ret = gpio_request_array(mx27_3ds_camera_gpios, |
525 | ARRAY_SIZE(mx27_3ds_camera_gpios)); | 535 | ARRAY_SIZE(mx27_3ds_camera_gpios)); |
@@ -529,7 +539,6 @@ static void __init mx27pdk_init(void) | |||
529 | } | 539 | } |
530 | 540 | ||
531 | imx27_add_mx2_camera(&mx27_3ds_cam_pdata); | 541 | imx27_add_mx2_camera(&mx27_3ds_cam_pdata); |
532 | imx27_add_imx_ssi(0, &mx27_3ds_ssi_pdata); | ||
533 | 542 | ||
534 | imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0); | 543 | imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0); |
535 | } | 544 | } |
@@ -547,5 +556,6 @@ MACHINE_START(MX27_3DS, "Freescale MX27PDK") | |||
547 | .init_irq = mx27_init_irq, | 556 | .init_irq = mx27_init_irq, |
548 | .init_time = mx27pdk_timer_init, | 557 | .init_time = mx27pdk_timer_init, |
549 | .init_machine = mx27pdk_init, | 558 | .init_machine = mx27pdk_init, |
559 | .init_late = mx27pdk_late_init, | ||
550 | .restart = mxc_restart, | 560 | .restart = mxc_restart, |
551 | MACHINE_END | 561 | MACHINE_END |