i.MX2: make SoC devices globally available
authorSascha Hauer <s.hauer@pengutronix.de>
Tue, 9 Sep 2008 08:19:41 +0000 (10:19 +0200)
committerSascha Hauer <s.hauer@pengutronix.de>
Tue, 9 Sep 2008 08:19:41 +0000 (10:19 +0200)
Make SoC devices globally available to boards rather than using
a device specific init function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/mach-mx2/devices.h [new file with mode: 0644]
arch/arm/mach-mx2/mx27ads.c
arch/arm/mach-mx2/pcm038.c
arch/arm/mach-mx2/serial.c

diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h
new file mode 100644 (file)
index 0000000..c77a4b8
--- /dev/null
@@ -0,0 +1,15 @@
+
+extern struct platform_device mxc_gpt1;
+extern struct platform_device mxc_gpt2;
+extern struct platform_device mxc_gpt3;
+extern struct platform_device mxc_gpt4;
+extern struct platform_device mxc_gpt5;
+extern struct platform_device mxc_wdt;
+extern struct platform_device mxc_irda_device;
+extern struct platform_device mxc_uart_device0;
+extern struct platform_device mxc_uart_device1;
+extern struct platform_device mxc_uart_device2;
+extern struct platform_device mxc_uart_device3;
+extern struct platform_device mxc_uart_device4;
+extern struct platform_device mxc_uart_device5;
+
index 4ce56ef..56e22d3 100644 (file)
@@ -34,6 +34,8 @@
 #include <mach/iomux-mx1-mx2.h>
 #include <mach/board-mx27ads.h>
 
+#include "devices.h"
+
 /* ADS's NOR flash */
 static struct physmap_flash_data mx27ads_flash_data = {
        .width = 2,
@@ -251,12 +253,14 @@ static struct imxuart_platform_data uart_pdata[] = {
 
 static void __init mx27ads_board_init(void)
 {
-       int i;
-
        gpio_fec_active();
 
-       for (i = 0; i < 6; i++)
-               imx_init_uart(i, &uart_pdata[i]);
+       mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
+       mxc_register_device(&mxc_uart_device1, &uart_pdata[1]);
+       mxc_register_device(&mxc_uart_device2, &uart_pdata[2]);
+       mxc_register_device(&mxc_uart_device3, &uart_pdata[3]);
+       mxc_register_device(&mxc_uart_device4, &uart_pdata[4]);
+       mxc_register_device(&mxc_uart_device5, &uart_pdata[5]);
 
        platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
 }
index 1028f45..7f55746 100644 (file)
@@ -28,6 +28,8 @@
 #include <mach/imx-uart.h>
 #include <mach/board-pcm038.h>
 
+#include "devices.h"
+
 /*
  * Phytec's phyCORE-i.MX27 comes with 32MiB flash,
  * 16 bit width
@@ -170,11 +172,11 @@ static struct platform_device *platform_devices[] __initdata = {
 
 static void __init pcm038_init(void)
 {
-       int i;
        gpio_fec_active();
 
-       for (i = 0; i < 3; i++)
-               imx_init_uart(i, &uart_pdata[i]);
+       mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
+       mxc_register_device(&mxc_uart_device1, &uart_pdata[1]);
+       mxc_register_device(&mxc_uart_device2, &uart_pdata[2]);
 
        platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
 
Simple merge