Skip to content

Commit d3e952a

Browse files
jkrzyszttmlind
authored andcommitted
ARM: OMAP1: ams-delta: register MODEM device earlier
Amstrad Delta MODEM device used to be initialized at arch_initcall before it was once moved to late_initcall by commit f7519d8 ("ARM: OMAP1: ams-delta: register latch dependent devices later"). The purpose of that change was to postpone initialization of devices which depended on latch2 pins until latch2 converted to GPIO device was ready. After recent fixes to GPIO handling, it was possible to moove registration of most of those device back to where they were before. The same can be safely done with the MODEM device as initialization of GPIO pins it depends on was moved to machine_init by preceding patch. Move registration of the MODEM device to arch_initcall_sync, not to arch_initcall, so it is never exposed to potential conflict in registration order hazard against OMAP serial ports. Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
1 parent 1464d03 commit d3e952a

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

arch/arm/mach-omap1/board-ams-delta.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -896,11 +896,28 @@ static int __init modem_nreset_init(void)
896896
/*
897897
* This function expects MODEM IRQ number already assigned to the port
898898
* and fails if it's not.
899+
* The MODEM device requires its RESET# pin kept high during probe.
900+
* That requirement can be fulfilled in several ways:
901+
* - with a descriptor of already functional modem_nreset regulator
902+
* assigned to the MODEM private data,
903+
* - with the regulator not yet controlled by modem_pm function but
904+
* already enabled by default on probe,
905+
* - before the modem_nreset regulator is probed, with the pin already
906+
* set high explicitly.
907+
* The last one is already guaranteed by ams_delta_latch2_init() called
908+
* from machine_init.
909+
* In order to avoid taking over ttyS0 device slot, the MODEM device
910+
* should be registered after OMAP serial ports. Since those ports
911+
* are registered at arch_initcall, this function can be called safely
912+
* at arch_initcall_sync earliest.
899913
*/
900914
static int __init ams_delta_modem_init(void)
901915
{
902916
int err;
903917

918+
if (!machine_is_ams_delta())
919+
return -ENODEV;
920+
904921
if (ams_delta_modem_ports[0].irq < 0)
905922
return ams_delta_modem_ports[0].irq;
906923

@@ -913,6 +930,7 @@ static int __init ams_delta_modem_init(void)
913930

914931
return err;
915932
}
933+
arch_initcall_sync(ams_delta_modem_init);
916934

917935
static int __init late_init(void)
918936
{
@@ -922,10 +940,6 @@ static int __init late_init(void)
922940
if (err)
923941
return err;
924942

925-
err = ams_delta_modem_init();
926-
if (err)
927-
return err;
928-
929943
/*
930944
* Once the modem device is registered, the modem_nreset
931945
* regulator can be requested on behalf of that device.

0 commit comments

Comments
 (0)