From patchwork Mon Sep 19 01:37:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 9338411 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2FFDD6077F for ; Mon, 19 Sep 2016 01:45:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F15328DEE for ; Mon, 19 Sep 2016 01:45:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 125EF28DFA; Mon, 19 Sep 2016 01:45:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A54DE28DEE for ; Mon, 19 Sep 2016 01:45:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1blncY-0005dR-RR; Mon, 19 Sep 2016 01:43:46 +0000 Received: from mleia.com ([178.79.152.223] helo=mail.mleia.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1blnXO-0000bu-CD for linux-arm-kernel@lists.infradead.org; Mon, 19 Sep 2016 01:38:31 +0000 Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id 28DAF43E1DD; Mon, 19 Sep 2016 02:37:46 +0100 (BST) From: Vladimir Zapolskiy To: Shawn Guo , Sascha Hauer , Fabio Estevam Subject: [PATCH 09/19] ARM: imx legacy: mx31moboard: move peripheral initialization to .init_late Date: Mon, 19 Sep 2016 04:37:21 +0300 Message-Id: <1474249051-10718-9-git-send-email-vz@mleia.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1474248988-10626-1-git-send-email-vz@mleia.com> References: <1474248988-10626-1-git-send-email-vz@mleia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20160919_023746_189882_25C49065 X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160919_023746_189882_25C49065 X-CRM114-Status: UNSURE ( 8.53 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- arch/arm/mach-imx/mach-mx31moboard.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c index 4f2d998..cc86768 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) "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