diff options
author | Vladimir Zapolskiy <vz@mleia.com> | 2016-09-18 21:37:23 -0400 |
---|---|---|
committer | Shawn Guo <shawnguo@kernel.org> | 2016-09-20 10:35:17 -0400 |
commit | 598b2505b1b960e49ab050d61804566716818a6d (patch) | |
tree | 5657e96c8a5fab3ae422c5d77d3adb473eeb2f09 /arch/arm/mach-imx | |
parent | 8f39bd1553965f052a9ed84ef7da289b47e96c19 (diff) |
ARM: imx legacy: imx27-visstrim-m10: 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>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c index ede2bdbb5dd5..dd75a4756761 100644 --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c | |||
@@ -540,7 +540,6 @@ static void __init visstrim_m10_revision(void) | |||
540 | static void __init visstrim_m10_board_init(void) | 540 | static void __init visstrim_m10_board_init(void) |
541 | { | 541 | { |
542 | int ret; | 542 | int ret; |
543 | int mo_version; | ||
544 | 543 | ||
545 | imx27_soc_init(); | 544 | imx27_soc_init(); |
546 | visstrim_m10_revision(); | 545 | visstrim_m10_revision(); |
@@ -550,11 +549,6 @@ static void __init visstrim_m10_board_init(void) | |||
550 | if (ret) | 549 | if (ret) |
551 | pr_err("Failed to setup pins (%d)\n", ret); | 550 | pr_err("Failed to setup pins (%d)\n", ret); |
552 | 551 | ||
553 | ret = gpio_request_array(visstrim_m10_gpios, | ||
554 | ARRAY_SIZE(visstrim_m10_gpios)); | ||
555 | if (ret) | ||
556 | pr_err("Failed to request gpios (%d)\n", ret); | ||
557 | |||
558 | imx27_add_imx_ssi(0, &visstrim_m10_ssi_pdata); | 552 | imx27_add_imx_ssi(0, &visstrim_m10_ssi_pdata); |
559 | imx27_add_imx_uart0(&uart_pdata); | 553 | imx27_add_imx_uart0(&uart_pdata); |
560 | 554 | ||
@@ -566,12 +560,26 @@ static void __init visstrim_m10_board_init(void) | |||
566 | imx27_add_mxc_mmc(0, &visstrim_m10_sdhc_pdata); | 560 | imx27_add_mxc_mmc(0, &visstrim_m10_sdhc_pdata); |
567 | imx27_add_mxc_ehci_otg(&visstrim_m10_usbotg_pdata); | 561 | imx27_add_mxc_ehci_otg(&visstrim_m10_usbotg_pdata); |
568 | imx27_add_fec(NULL); | 562 | imx27_add_fec(NULL); |
569 | imx_add_gpio_keys(&visstrim_gpio_keys_platform_data); | 563 | |
570 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 564 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
565 | } | ||
566 | |||
567 | static void __init visstrim_m10_late_init(void) | ||
568 | { | ||
569 | int mo_version, ret; | ||
570 | |||
571 | ret = gpio_request_array(visstrim_m10_gpios, | ||
572 | ARRAY_SIZE(visstrim_m10_gpios)); | ||
573 | if (ret) | ||
574 | pr_err("Failed to request gpios (%d)\n", ret); | ||
575 | |||
576 | imx_add_gpio_keys(&visstrim_gpio_keys_platform_data); | ||
577 | |||
571 | imx_add_platform_device("mx27vis", 0, NULL, 0, &snd_mx27vis_pdata, | 578 | imx_add_platform_device("mx27vis", 0, NULL, 0, &snd_mx27vis_pdata, |
572 | sizeof(snd_mx27vis_pdata)); | 579 | sizeof(snd_mx27vis_pdata)); |
573 | platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0, | 580 | platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0, |
574 | &iclink_tvp5150, sizeof(iclink_tvp5150)); | 581 | &iclink_tvp5150, sizeof(iclink_tvp5150)); |
582 | |||
575 | gpio_led_register_device(0, &visstrim_m10_led_data); | 583 | gpio_led_register_device(0, &visstrim_m10_led_data); |
576 | 584 | ||
577 | /* Use mother board version to decide what video devices we shall use */ | 585 | /* Use mother board version to decide what video devices we shall use */ |
@@ -591,6 +599,7 @@ static void __init visstrim_m10_board_init(void) | |||
591 | visstrim_deinterlace_init(); | 599 | visstrim_deinterlace_init(); |
592 | visstrim_analog_camera_init(); | 600 | visstrim_analog_camera_init(); |
593 | } | 601 | } |
602 | |||
594 | visstrim_coda_init(); | 603 | visstrim_coda_init(); |
595 | } | 604 | } |
596 | 605 | ||
@@ -607,5 +616,6 @@ MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10") | |||
607 | .init_irq = mx27_init_irq, | 616 | .init_irq = mx27_init_irq, |
608 | .init_time = visstrim_m10_timer_init, | 617 | .init_time = visstrim_m10_timer_init, |
609 | .init_machine = visstrim_m10_board_init, | 618 | .init_machine = visstrim_m10_board_init, |
619 | .init_late = visstrim_m10_late_init, | ||
610 | .restart = mxc_restart, | 620 | .restart = mxc_restart, |
611 | MACHINE_END | 621 | MACHINE_END |