From 4db0ba22da9f4406c292a6a6110eeb2edd12f16a Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Thu, 15 Jan 2015 15:59:27 +0100 Subject: ARM: at91: pm: prepare for multiplatform Split at91_pm_init() in three variants that are called by the respective SoCs .init_machine. This allows to remove the of_machine_is_compatible() calls and move at91_pm_init() out of arch_initcall() which is required for multiplatform. Signed-off-by: Alexandre Belloni Signed-off-by: Nicolas Ferre --- arch/arm/mach-at91/board-dt-sam9.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'arch/arm/mach-at91/board-dt-sam9.c') diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c index f99246aa9b38..0fe1ced608c5 100644 --- a/arch/arm/mach-at91/board-dt-sam9.c +++ b/arch/arm/mach-at91/board-dt-sam9.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -23,6 +24,12 @@ #include "generic.h" +static void __init sam9_dt_device_init(void) +{ + at91_sam9260_pm_init(); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); +} + static const char *at91_dt_board_compat[] __initdata = { "atmel,at91sam9", NULL @@ -32,5 +39,25 @@ DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)") /* Maintainer: Atmel */ .map_io = at91_map_io, .init_early = at91_dt_initialize, + .init_machine = sam9_dt_device_init, .dt_compat = at91_dt_board_compat, MACHINE_END + +static void __init sam9g45_dt_device_init(void) +{ + at91_sam9g45_pm_init(); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); +} + +static const char *at91_9g45_board_compat[] __initconst = { + "atmel,at91sam9g45", + NULL +}; + +DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45") + /* Maintainer: Atmel */ + .map_io = at91_map_io, + .init_early = at91_dt_initialize, + .init_machine = sam9g45_dt_device_init, + .dt_compat = at91_9g45_board_compat, +MACHINE_END -- cgit v1.2.3