]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: imx legacy: mx31moboard: move peripheral initialization to .init_late
authorVladimir Zapolskiy <vz@mleia.com>
Mon, 19 Sep 2016 01:37:21 +0000 (04:37 +0300)
committerShawn Guo <shawnguo@kernel.org>
Tue, 20 Sep 2016 14:35:11 +0000 (22:35 +0800)
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>
arch/arm/mach-imx/mach-mx31moboard.c

index 4f2d99888afd28833044022396a6ea9582a2c994..cc867682520ef144cc6d54ced7e3285c2044b55d 100644 (file)
@@ -526,11 +526,9 @@ static void __init mx31moboard_init(void)
                "moboard");
 
        platform_add_devices(devices, ARRAY_SIZE(devices));
-       gpio_led_register_device(-1, &mx31moboard_led_pdata);
 
        imx31_add_imx2_wdt();
 
-       moboard_uart0_init();
        imx31_add_imx_uart0(&uart0_pdata);
        imx31_add_imx_uart4(&uart4_pdata);
 
@@ -540,6 +538,19 @@ static void __init mx31moboard_init(void)
        imx31_add_spi_imx1(&moboard_spi1_pdata);
        imx31_add_spi_imx2(&moboard_spi2_pdata);
 
+       mx31moboard_init_cam();
+
+       imx31_add_imx_ssi(0, &moboard_ssi_pdata);
+
+       pm_power_off = mx31moboard_poweroff;
+}
+
+static void __init mx31moboard_late(void)
+{
+       gpio_led_register_device(-1, &mx31moboard_led_pdata);
+
+       moboard_uart0_init();
+
        gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq");
        gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
        moboard_spi_board_info[0].irq =
@@ -549,18 +560,11 @@ static void __init mx31moboard_init(void)
 
        imx31_add_mxc_mmc(0, &sdhc1_pdata);
 
-       mx31moboard_init_cam();
-
        usb_xcvr_reset();
-
        moboard_usbh2_init();
 
-       imx31_add_imx_ssi(0, &moboard_ssi_pdata);
-
        imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0);
 
-       pm_power_off = mx31moboard_poweroff;
-
        switch (mx31moboard_baseboard) {
        case MX31NOBOARD:
                break;
@@ -601,5 +605,6 @@ MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
        .init_irq = mx31_init_irq,
        .init_time      = mx31moboard_timer_init,
        .init_machine = mx31moboard_init,
+       .init_late      = mx31moboard_late,
        .restart        = mxc_restart,
 MACHINE_END