From patchwork Mon Jul 2 22:28:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 10502559 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 698B26028F for ; Mon, 2 Jul 2018 22:28:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 537EA28B59 for ; Mon, 2 Jul 2018 22:28:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4778D28B5C; Mon, 2 Jul 2018 22:28:43 +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=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DF36E28B59 for ; Mon, 2 Jul 2018 22:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=i4ieKrth/kxJt+25xilJfKToyqyOeydT+j8WSAmcITw=; b=JCE axpDghoSRCMhLVoUk3WIZKsdnK/6sj2D8nK1wxRmmY7Tj5rTmX30v35Y5E0Mz/TxaNg8jtNZ1opsT lexNtsfu/djsUr46J5+ajy7ILfbmlnVbw0i6FIH1L1eQtXT2oU4UroFTlsjE2gT0+RyF7HjXxqllL 8YLeJ0aE1i1YmTFEk49LgccBaDtopGmfVu0fwsHY16jfIS6aoarAycMCcMlwcoNwWKR8w/B0k7K6C Dq9oOCX69RdM2nkWZNytKTETpvljgrLvNHSrn2qmM5Pqan0ld6f8fAXx9AVQNURRhXhjIINWfmGBF o+koej/YTpAP2HVdgV04/yadUc9AvvQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fa7JG-000068-Ju; Mon, 02 Jul 2018 22:28:38 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fa7JD-0008WA-Af for linux-arm-kernel@lists.infradead.org; Mon, 02 Jul 2018 22:28:36 +0000 Received: by mail-lf0-x244.google.com with SMTP id u14-v6so8174797lfu.0 for ; Mon, 02 Jul 2018 15:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=VZgBIR9wRrC8KUG8GmkX+rQdixRza3owQ+sV683E2J4=; b=ReuSGwu9uN/bonm+zFLkF6tS+R+H98ud2Zb2svPnPwk/X41MnyezMcyoS3KPYAtRFw yRsybK8LDDjGp9xZZHU/fRJO1v5VcXsx1mRfHsADD8jEph8BS0XSSZS9vgb13mZHCBKV QoyctG25jIVEyACxHmezm/Hy8R1u7roLobg+icuw3WHWo8C2knX9xDST1KzxEcSGimQa sEpHvpFb/ITSMAvgNH/xvHalkFqAUrMcs3dyj/BfMga/fWnC0zlq/Jo43HOp91UwgqkX ACkjWfStJGHMxGI7S4rlkFWWw6zDCTNqpa6ayvswEQN5iUsfgp/3/NnDMfwS5o+NRqe6 D/Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=VZgBIR9wRrC8KUG8GmkX+rQdixRza3owQ+sV683E2J4=; b=aryp5/Lfkv6ioKLOHtals64G4yt5dFn/Wjheqrdkejxac/ykr++N2hQIKdkuWxo8wq n+5FzzLXcfRs904sYxFbOe5DzINkKEWFGeNIMIbLw/FUnbB39Emqg2/FVyr72Rq1Ygfa Pnf/ffnnxCS9TBl37Q4fugl07QNTYWwwvqmdv8VUtI92ZYLBFW72ku4qLe7fZ92PeisU 8D8sC2Ek2Z0PzRDY8rbGlOnkgNU49zXQRS/iShzQyuOZ7N1v4CADEiZi4hA4DCs3W9DW bFCeb3HP5M5TReEZMShOqZC/auo0kCM1DX0iMwecBwURCfZwxKl9Tk6P/lxKP1g7xHAc f5rg== X-Gm-Message-State: APt69E04gFN6sB5CWIDpvkul24N82WiEuj3LGz/FQS8hf6R5RN3wR748 Xz7Rc78kMqp0mgaHYmEnQxs= X-Google-Smtp-Source: AAOMgpdG0i6NnMXU4A1/xJaFRfOlC4tmxUCdeXxXQTw2T8PhmpzGdK8n3RYf6DmrImXxxIvmubBNuA== X-Received: by 2002:a19:5512:: with SMTP id n18-v6mr15729424lfe.133.1530570502977; Mon, 02 Jul 2018 15:28:22 -0700 (PDT) Received: from z50.lan (93-181-165-181.internetia.net.pl. [93.181.165.181]) by smtp.gmail.com with ESMTPSA id h1-v6sm1198144ljc.15.2018.07.02.15.28.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 15:28:22 -0700 (PDT) From: Janusz Krzysztofik To: Tony Lindgren Subject: [PATCH] ARM: OMAP1: ams-delta: move late devices back to init_machine Date: Tue, 3 Jul 2018 00:28:28 +0200 Message-Id: <20180702222828.27779-1-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.16.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180702_152835_392881_F6057A08 X-CRM114-Status: GOOD ( 13.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-omap@vger.kernel.org, Janusz Krzysztofik , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Aaro Koskinen 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 Initialization of several Amstrad Delta devices was once moved to late_initcall by commit f7519d8c8290 ("ARM: OMAP1: ams-delta: register latch dependent devices later"). The purpose of that move was to allow smooth conversion of Amstrad Delta latches to GPIO. After successful conversion only ams_delta_serio driver was moved back to device_initcall by commit 8d09a1bb3147 ("input: serio: ams-delta: toggle keyboard power over GPIO"). Registration of ams-delta-nand and lcd_ams_delta devices was kept in late_initcall in order to avoid corrupt data reported by the serio driver on boot. Registration of cx20442-codec device was kept there for it to be probed after a regulator on which it depended was ready. The issue of "keybrd_dataout" GPIO pin not initilized to GPIO_OUT_LOW before other latch2 pins causing the corruption have been apparently fixed by commit 5322c19b117a ("ARM: OMAP1: ams-delta: Hog "keybrd_dataout" GPIO pin"). In turn, the issue of missing regulator has been fixed by commit 50c678772a0b ("ASoC: cx20442: Don't ignore regulator_get() errors."). Simplify the board init code by moving registration of those devices back to init_machine. Signed-off-by: Janusz Krzysztofik --- Created and testet on top of recent commits 3e14de3bfb3a ("ARM: OMAP1: ams-delta: refactor late_init()") and 5322c19b117a ("ARM: OMAP1: ams-delta: Hog "keybrd_dataout" GPIO pin") found in branch omap-for-v4.19/omap1 of linux-omap tree as well as on commit 50c678772a0b ("ASoC: cx20442: Don't ignore regulator_get() errors.") already found in linux-next tree. arch/arm/mach-omap1/board-ams-delta.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 22f9be297c2a..dd28d2614d7f 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -596,9 +596,6 @@ static struct platform_device *ams_delta_devices[] __initdata = { &ams_delta_camera_device, &ams_delta_audio_device, &ams_delta_serio_device, -}; - -static struct platform_device *late_devices[] __initdata = { &ams_delta_nand_device, &ams_delta_lcd_device, &cx20442_codec_device, @@ -607,9 +604,6 @@ static struct platform_device *late_devices[] __initdata = { static struct gpiod_lookup_table *ams_delta_gpio_tables[] __initdata = { &ams_delta_audio_gpio_table, &keybrd_pwr_gpio_table, -}; - -static struct gpiod_lookup_table *late_gpio_tables[] __initdata = { &ams_delta_lcd_gpio_table, &ams_delta_nand_gpio_table, }; @@ -713,6 +707,8 @@ static void __init ams_delta_init(void) ams_delta_audio_gpio_table.dev_id = dev_name(&ams_delta_audio_device.dev); keybrd_pwr_gpio_table.dev_id = dev_name(&keybrd_pwr_device.dev); + ams_delta_nand_gpio_table.dev_id = dev_name(&ams_delta_nand_device.dev); + ams_delta_lcd_gpio_table.dev_id = dev_name(&ams_delta_lcd_device.dev); /* * Once GPIO lookup tables are populated with dev_names, register them. @@ -836,20 +832,6 @@ static int __init ams_delta_gpio_init(void) } device_initcall_sync(ams_delta_gpio_init); -static void __init ams_delta_late_devices(void) -{ - platform_add_devices(late_devices, ARRAY_SIZE(late_devices)); - - /* - * As soon as devices have been registered, assign their dev_names - * to respective GPIO lookup tables before they are added. - */ - ams_delta_lcd_gpio_table.dev_id = dev_name(&ams_delta_lcd_device.dev); - ams_delta_nand_gpio_table.dev_id = dev_name(&ams_delta_nand_device.dev); - - gpiod_add_lookup_tables(late_gpio_tables, ARRAY_SIZE(late_gpio_tables)); -} - static int __init modem_nreset_init(void) { int err; @@ -894,8 +876,6 @@ static int __init late_init(void) { int err; - ams_delta_late_devices(); - err = modem_nreset_init(); if (err) return err;