linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jmkrzyszt@gmail.com (Janusz Krzysztofik)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: OMAP1: ams-delta: move late devices back to init_machine
Date: Tue,  3 Jul 2018 00:28:28 +0200	[thread overview]
Message-ID: <20180702222828.27779-1-jmkrzyszt@gmail.com> (raw)

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 <jmkrzyszt@gmail.com>
---
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;
-- 
2.16.4

                 reply	other threads:[~2018-07-02 22:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180702222828.27779-1-jmkrzyszt@gmail.com \
    --to=jmkrzyszt@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).