aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2016-09-18 21:37:18 -0400
committerShawn Guo <shawnguo@kernel.org>2016-09-20 10:35:00 -0400
commitce689b0de5ec225e04eb9074888c3f2b16398c69 (patch)
tree90531f4bb3bfcf70c03eccb898c7c2b584f72827
parent347aa6c41317157b8f8333d058ca02e156748666 (diff)
ARM: imx legacy: mx31-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-mx31_3ds.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c
index 65a0dc06a97c..12b8a52c9cb4 100644
--- a/arch/arm/mach-imx/mach-mx31_3ds.c
+++ b/arch/arm/mach-imx/mach-mx31_3ds.c
@@ -694,8 +694,6 @@ static struct platform_device *devices[] __initdata = {
694 694
695static void __init mx31_3ds_init(void) 695static void __init mx31_3ds_init(void)
696{ 696{
697 int ret;
698
699 imx31_soc_init(); 697 imx31_soc_init();
700 698
701 /* Configure SPI1 IOMUX */ 699 /* Configure SPI1 IOMUX */
@@ -708,14 +706,31 @@ static void __init mx31_3ds_init(void)
708 imx31_add_mxc_nand(&mx31_3ds_nand_board_info); 706 imx31_add_mxc_nand(&mx31_3ds_nand_board_info);
709 707
710 imx31_add_spi_imx1(&spi1_pdata); 708 imx31_add_spi_imx1(&spi1_pdata);
709
710 imx31_add_imx_keypad(&mx31_3ds_keymap_data);
711
712 imx31_add_imx2_wdt();
713 imx31_add_imx_i2c0(&mx31_3ds_i2c0_data);
714
715 imx31_add_spi_imx0(&spi0_pdata);
716 imx31_add_ipu_core();
717 imx31_add_mx3_sdc_fb(&mx3fb_pdata);
718
719 imx31_add_imx_ssi(0, &mx31_3ds_ssi_pdata);
720
721 imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0);
722}
723
724static void __init mx31_3ds_late(void)
725{
726 int ret;
727
711 mx31_3ds_spi_devs[0].irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); 728 mx31_3ds_spi_devs[0].irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
712 spi_register_board_info(mx31_3ds_spi_devs, 729 spi_register_board_info(mx31_3ds_spi_devs,
713 ARRAY_SIZE(mx31_3ds_spi_devs)); 730 ARRAY_SIZE(mx31_3ds_spi_devs));
714 731
715 platform_add_devices(devices, ARRAY_SIZE(devices)); 732 platform_add_devices(devices, ARRAY_SIZE(devices));
716 733
717 imx31_add_imx_keypad(&mx31_3ds_keymap_data);
718
719 mx31_3ds_usbotg_init(); 734 mx31_3ds_usbotg_init();
720 if (otg_mode_host) { 735 if (otg_mode_host) {
721 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | 736 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
@@ -733,14 +748,9 @@ static void __init mx31_3ds_init(void)
733 748
734 if (mxc_expio_init(MX31_CS5_BASE_ADDR, IOMUX_TO_GPIO(MX31_PIN_GPIO1_1))) 749 if (mxc_expio_init(MX31_CS5_BASE_ADDR, IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)))
735 printk(KERN_WARNING "Init of the debug board failed, all " 750 printk(KERN_WARNING "Init of the debug board failed, all "
736 "devices on the debug board are unusable.\n"); 751 "devices on the debug board are unusable.\n");
737 imx31_add_imx2_wdt();
738 imx31_add_imx_i2c0(&mx31_3ds_i2c0_data);
739 imx31_add_mxc_mmc(0, &sdhc1_pdata);
740 752
741 imx31_add_spi_imx0(&spi0_pdata); 753 imx31_add_mxc_mmc(0, &sdhc1_pdata);
742 imx31_add_ipu_core();
743 imx31_add_mx3_sdc_fb(&mx3fb_pdata);
744 754
745 /* CSI */ 755 /* CSI */
746 /* Camera power: default - off */ 756 /* Camera power: default - off */
@@ -752,10 +762,6 @@ static void __init mx31_3ds_init(void)
752 } 762 }
753 763
754 mx31_3ds_init_camera(); 764 mx31_3ds_init_camera();
755
756 imx31_add_imx_ssi(0, &mx31_3ds_ssi_pdata);
757
758 imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0);
759} 765}
760 766
761static void __init mx31_3ds_timer_init(void) 767static void __init mx31_3ds_timer_init(void)
@@ -778,6 +784,7 @@ MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
778 .init_irq = mx31_init_irq, 784 .init_irq = mx31_init_irq,
779 .init_time = mx31_3ds_timer_init, 785 .init_time = mx31_3ds_timer_init,
780 .init_machine = mx31_3ds_init, 786 .init_machine = mx31_3ds_init,
787 .init_late = mx31_3ds_late,
781 .reserve = mx31_3ds_reserve, 788 .reserve = mx31_3ds_reserve,
782 .restart = mxc_restart, 789 .restart = mxc_restart,
783MACHINE_END 790MACHINE_END