From e328b88094b712e4010a805499ceff774e2795b7 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Fri, 26 Apr 2013 19:47:29 +0400 Subject: ARM: clps711x: Re-add GPIO support arch_initcall was been removed from GPIO driver, so this patch re-add support for GPIO into boards as platform_device. Since some drivers (spi, nand, etc.) is not support deferred probe, separate machine init calls is used in board code to make proper loading sequence. Signed-off-by: Alexander Shiyan Acked-by: Arnd Bergmann Acked-by: Linus Walleij Signed-off-by: Olof Johansson --- arch/arm/mach-clps711x/Makefile | 5 +--- arch/arm/mach-clps711x/board-autcpu12.c | 2 ++ arch/arm/mach-clps711x/board-cdb89712.c | 2 ++ arch/arm/mach-clps711x/board-edb7211.c | 7 +++++ arch/arm/mach-clps711x/board-p720t.c | 10 ++++--- arch/arm/mach-clps711x/devices.c | 48 +++++++++++++++++++++++++++++++++ arch/arm/mach-clps711x/devices.h | 12 +++++++++ 7 files changed, 78 insertions(+), 8 deletions(-) create mode 100644 arch/arm/mach-clps711x/devices.c create mode 100644 arch/arm/mach-clps711x/devices.h (limited to 'arch') diff --git a/arch/arm/mach-clps711x/Makefile b/arch/arm/mach-clps711x/Makefile index 992995af666..f30ed2b496f 100644 --- a/arch/arm/mach-clps711x/Makefile +++ b/arch/arm/mach-clps711x/Makefile @@ -4,10 +4,7 @@ # Object file lists. -obj-y := common.o -obj-m := -obj-n := -obj- := +obj-y := common.o devices.o obj-$(CONFIG_ARCH_AUTCPU12) += board-autcpu12.o obj-$(CONFIG_ARCH_CDB89712) += board-cdb89712.o diff --git a/arch/arm/mach-clps711x/board-autcpu12.c b/arch/arm/mach-clps711x/board-autcpu12.c index f38584709df..1e22cb4726b 100644 --- a/arch/arm/mach-clps711x/board-autcpu12.c +++ b/arch/arm/mach-clps711x/board-autcpu12.c @@ -43,6 +43,7 @@ #include #include "common.h" +#include "devices.h" #define AUTCPU12_CS8900_BASE (CS2_PHYS_BASE + 0x300) #define AUTCPU12_CS8900_IRQ (IRQ_EINT3) @@ -149,6 +150,7 @@ static struct platform_device autcpu12_mmgpio_pdev __initdata = { static void __init autcpu12_init(void) { + clps711x_devices_init(); platform_device_register_simple("video-clps711x", 0, NULL, 0); platform_device_register_simple("cs89x0", 0, autcpu12_cs8900_resource, ARRAY_SIZE(autcpu12_cs8900_resource)); diff --git a/arch/arm/mach-clps711x/board-cdb89712.c b/arch/arm/mach-clps711x/board-cdb89712.c index baab7da33c9..a80ae57743f 100644 --- a/arch/arm/mach-clps711x/board-cdb89712.c +++ b/arch/arm/mach-clps711x/board-cdb89712.c @@ -39,6 +39,7 @@ #include #include "common.h" +#include "devices.h" #define CDB89712_CS8900_BASE (CS2_PHYS_BASE + 0x300) #define CDB89712_CS8900_IRQ (IRQ_EINT3) @@ -127,6 +128,7 @@ static struct platform_device cdb89712_sram_pdev __initdata = { static void __init cdb89712_init(void) { + clps711x_devices_init(); platform_device_register(&cdb89712_flash_pdev); platform_device_register(&cdb89712_bootrom_pdev); platform_device_register(&cdb89712_sram_pdev); diff --git a/arch/arm/mach-clps711x/board-edb7211.c b/arch/arm/mach-clps711x/board-edb7211.c index 5f928e9ed2e..e1c5573e92c 100644 --- a/arch/arm/mach-clps711x/board-edb7211.c +++ b/arch/arm/mach-clps711x/board-edb7211.c @@ -29,6 +29,7 @@ #include #include "common.h" +#include "devices.h" #define VIDEORAM_SIZE SZ_128K @@ -150,6 +151,11 @@ fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi) } static void __init edb7211_init(void) +{ + clps711x_devices_init(); +} + +static void __init edb7211_init_late(void) { gpio_request_array(edb7211_gpios, ARRAY_SIZE(edb7211_gpios)); @@ -175,6 +181,7 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") .init_irq = clps711x_init_irq, .init_time = clps711x_timer_init, .init_machine = edb7211_init, + .init_late = edb7211_init_late, .handle_irq = clps711x_handle_irq, .restart = clps711x_restart, MACHINE_END diff --git a/arch/arm/mach-clps711x/board-p720t.c b/arch/arm/mach-clps711x/board-p720t.c index 8d3ee677113..48d073716eb 100644 --- a/arch/arm/mach-clps711x/board-p720t.c +++ b/arch/arm/mach-clps711x/board-p720t.c @@ -43,6 +43,7 @@ #include