diff options
author | Vladimir Zapolskiy <vz@mleia.com> | 2016-09-18 21:37:21 -0400 |
---|---|---|
committer | Shawn Guo <shawnguo@kernel.org> | 2016-09-20 10:35:11 -0400 |
commit | 1cecfa48d98f6b07db8ed0cfda6f18ef3c8f9121 (patch) | |
tree | c5a4ceee093556e25a764d27b58f6ff2e3f92b14 | |
parent | a95a9322df400b5b4a9dc49dffbb30742ecc5497 (diff) |
ARM: imx legacy: mx31moboard: 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-mx31moboard.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c index 4f2d99888afd..cc867682520e 100644 --- a/arch/arm/mach-imx/mach-mx31moboard.c +++ b/arch/arm/mach-imx/mach-mx31moboard.c | |||
@@ -526,11 +526,9 @@ static void __init mx31moboard_init(void) | |||
526 | "moboard"); | 526 | "moboard"); |
527 | 527 | ||
528 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 528 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
529 | gpio_led_register_device(-1, &mx31moboard_led_pdata); | ||
530 | 529 | ||
531 | imx31_add_imx2_wdt(); | 530 | imx31_add_imx2_wdt(); |
532 | 531 | ||
533 | moboard_uart0_init(); | ||
534 | imx31_add_imx_uart0(&uart0_pdata); | 532 | imx31_add_imx_uart0(&uart0_pdata); |
535 | imx31_add_imx_uart4(&uart4_pdata); | 533 | imx31_add_imx_uart4(&uart4_pdata); |
536 | 534 | ||
@@ -540,6 +538,19 @@ static void __init mx31moboard_init(void) | |||
540 | imx31_add_spi_imx1(&moboard_spi1_pdata); | 538 | imx31_add_spi_imx1(&moboard_spi1_pdata); |
541 | imx31_add_spi_imx2(&moboard_spi2_pdata); | 539 | imx31_add_spi_imx2(&moboard_spi2_pdata); |
542 | 540 | ||
541 | mx31moboard_init_cam(); | ||
542 | |||
543 | imx31_add_imx_ssi(0, &moboard_ssi_pdata); | ||
544 | |||
545 | pm_power_off = mx31moboard_poweroff; | ||
546 | } | ||
547 | |||
548 | static void __init mx31moboard_late(void) | ||
549 | { | ||
550 | gpio_led_register_device(-1, &mx31moboard_led_pdata); | ||
551 | |||
552 | moboard_uart0_init(); | ||
553 | |||
543 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq"); | 554 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq"); |
544 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); | 555 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); |
545 | moboard_spi_board_info[0].irq = | 556 | moboard_spi_board_info[0].irq = |
@@ -549,18 +560,11 @@ static void __init mx31moboard_init(void) | |||
549 | 560 | ||
550 | imx31_add_mxc_mmc(0, &sdhc1_pdata); | 561 | imx31_add_mxc_mmc(0, &sdhc1_pdata); |
551 | 562 | ||
552 | mx31moboard_init_cam(); | ||
553 | |||
554 | usb_xcvr_reset(); | 563 | usb_xcvr_reset(); |
555 | |||
556 | moboard_usbh2_init(); | 564 | moboard_usbh2_init(); |
557 | 565 | ||
558 | imx31_add_imx_ssi(0, &moboard_ssi_pdata); | ||
559 | |||
560 | imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0); | 566 | imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0); |
561 | 567 | ||
562 | pm_power_off = mx31moboard_poweroff; | ||
563 | |||
564 | switch (mx31moboard_baseboard) { | 568 | switch (mx31moboard_baseboard) { |
565 | case MX31NOBOARD: | 569 | case MX31NOBOARD: |
566 | break; | 570 | break; |
@@ -601,5 +605,6 @@ MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard") | |||
601 | .init_irq = mx31_init_irq, | 605 | .init_irq = mx31_init_irq, |
602 | .init_time = mx31moboard_timer_init, | 606 | .init_time = mx31moboard_timer_init, |
603 | .init_machine = mx31moboard_init, | 607 | .init_machine = mx31moboard_init, |
608 | .init_late = mx31moboard_late, | ||
604 | .restart = mxc_restart, | 609 | .restart = mxc_restart, |
605 | MACHINE_END | 610 | MACHINE_END |