aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32
diff options
context:
space:
mode:
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-10-23 08:42:19 -0400
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-10-23 09:18:33 -0400
commite82c6106b04b85879d802bbbeaed30d9b10a92e2 (patch)
tree99758574cb3555001fff0cb3aebc0de654e7e9a3 /arch/avr32
parente3f91ca48162c3eb70450314a4d09384fccb92fa (diff)
avr32: Fix GPIO initcall breakage
Add essential system devices, including GPIO controllers, automatically at core_initcall time. This ensures that the devices are there when the PIO driver gets initialized at postcore_initcall, fixing a bug exposed by commit d6634db8fe1784d0a8e4e156970fec034708446e "avr32: Use platform_driver_probe for pio platform driver". Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32')
-rw-r--r--arch/avr32/boards/atngw100/setup.c2
-rw-r--r--arch/avr32/boards/atstk1000/atstk1002.c2
-rw-r--r--arch/avr32/boards/atstk1000/atstk1003.c2
-rw-r--r--arch/avr32/boards/atstk1000/atstk1004.c2
-rw-r--r--arch/avr32/mach-at32ap/at32ap700x.c5
-rw-r--r--arch/avr32/mach-at32ap/include/mach/board.h10
6 files changed, 12 insertions, 11 deletions
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c
index 6c54580a66df..259ceee02b62 100644
--- a/arch/avr32/boards/atngw100/setup.c
+++ b/arch/avr32/boards/atngw100/setup.c
@@ -172,8 +172,6 @@ static int __init atngw100_init(void)
172 * reserve any pins for it. 172 * reserve any pins for it.
173 */ 173 */
174 174
175 at32_add_system_devices();
176
177 at32_add_device_usart(0); 175 at32_add_device_usart(0);
178 176
179 set_hw_addr(at32_add_device_eth(0, &eth_data[0])); 177 set_hw_addr(at32_add_device_eth(0, &eth_data[0]));
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c
index 29e5b51a7fd2..5c5cdf3b464f 100644
--- a/arch/avr32/boards/atstk1000/atstk1002.c
+++ b/arch/avr32/boards/atstk1000/atstk1002.c
@@ -305,8 +305,6 @@ static int __init atstk1002_init(void)
305 at32_reserve_pin(GPIO_PIN_PE(15)); /* DATA[31] */ 305 at32_reserve_pin(GPIO_PIN_PE(15)); /* DATA[31] */
306 at32_reserve_pin(GPIO_PIN_PE(26)); /* SDCS */ 306 at32_reserve_pin(GPIO_PIN_PE(26)); /* SDCS */
307 307
308 at32_add_system_devices();
309
310#ifdef CONFIG_BOARD_ATSTK1006 308#ifdef CONFIG_BOARD_ATSTK1006
311 smc_set_timing(&nand_config, &nand_timing); 309 smc_set_timing(&nand_config, &nand_timing);
312 smc_set_configuration(3, &nand_config); 310 smc_set_configuration(3, &nand_config);
diff --git a/arch/avr32/boards/atstk1000/atstk1003.c b/arch/avr32/boards/atstk1000/atstk1003.c
index be089d7f37eb..134b566630b0 100644
--- a/arch/avr32/boards/atstk1000/atstk1003.c
+++ b/arch/avr32/boards/atstk1000/atstk1003.c
@@ -149,8 +149,6 @@ static int __init atstk1003_init(void)
149 at32_reserve_pin(GPIO_PIN_PE(15)); /* DATA[31] */ 149 at32_reserve_pin(GPIO_PIN_PE(15)); /* DATA[31] */
150 at32_reserve_pin(GPIO_PIN_PE(26)); /* SDCS */ 150 at32_reserve_pin(GPIO_PIN_PE(26)); /* SDCS */
151 151
152 at32_add_system_devices();
153
154#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM 152#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
155 at32_add_device_usart(1); 153 at32_add_device_usart(1);
156#else 154#else
diff --git a/arch/avr32/boards/atstk1000/atstk1004.c b/arch/avr32/boards/atstk1000/atstk1004.c
index 248ef237c167..cb32eb844aa7 100644
--- a/arch/avr32/boards/atstk1000/atstk1004.c
+++ b/arch/avr32/boards/atstk1000/atstk1004.c
@@ -132,8 +132,6 @@ void __init setup_board(void)
132 132
133static int __init atstk1004_init(void) 133static int __init atstk1004_init(void)
134{ 134{
135 at32_add_system_devices();
136
137#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM 135#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
138 at32_add_device_usart(1); 136 at32_add_device_usart(1);
139#else 137#else
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index 8c435a6f4a6c..748ac68c73dc 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -813,7 +813,7 @@ static struct resource pio4_resource[] = {
813DEFINE_DEV(pio, 4); 813DEFINE_DEV(pio, 4);
814DEV_CLK(mck, pio4, pba, 14); 814DEV_CLK(mck, pio4, pba, 14);
815 815
816void __init at32_add_system_devices(void) 816static int __init system_device_init(void)
817{ 817{
818 platform_device_register(&at32_pm0_device); 818 platform_device_register(&at32_pm0_device);
819 platform_device_register(&at32_intc0_device); 819 platform_device_register(&at32_intc0_device);
@@ -832,7 +832,10 @@ void __init at32_add_system_devices(void)
832 platform_device_register(&pio2_device); 832 platform_device_register(&pio2_device);
833 platform_device_register(&pio3_device); 833 platform_device_register(&pio3_device);
834 platform_device_register(&pio4_device); 834 platform_device_register(&pio4_device);
835
836 return 0;
835} 837}
838core_initcall(system_device_init);
836 839
837/* -------------------------------------------------------------------- 840/* --------------------------------------------------------------------
838 * PSIF 841 * PSIF
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h
index c48386d66bc3..aafaf7a78886 100644
--- a/arch/avr32/mach-at32ap/include/mach/board.h
+++ b/arch/avr32/mach-at32ap/include/mach/board.h
@@ -14,8 +14,14 @@
14 */ 14 */
15extern unsigned long at32_board_osc_rates[]; 15extern unsigned long at32_board_osc_rates[];
16 16
17/* Add basic devices: system manager, interrupt controller, portmuxes, etc. */ 17/*
18void at32_add_system_devices(void); 18 * This used to add essential system devices, but this is now done
19 * automatically. Please don't use it in new board code.
20 */
21static inline void __deprecated at32_add_system_devices(void)
22{
23
24}
19 25
20#define ATMEL_MAX_UART 4 26#define ATMEL_MAX_UART 4
21extern struct platform_device *atmel_default_console_device; 27extern struct platform_device *atmel_default_console_device;