aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-08-25 11:37:45 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-09-27 09:46:38 -0400
commit4697bb926f43b8012ebd111ef43834f42126a0ef (patch)
treebd913f4f8ea631e50aff81b18cec211f5b7ddc91 /arch/arm/mach-mx3
parent5162de08d116fe7bbb912b17d84169983bfa16a8 (diff)
ARM: imx: dynamically allocate imx-ssi devices
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3')
-rw-r--r--arch/arm/mach-mx3/Kconfig6
-rw-r--r--arch/arm/mach-mx3/devices-imx31.h4
-rw-r--r--arch/arm/mach-mx3/devices-imx35.h4
-rw-r--r--arch/arm/mach-mx3/devices.c42
-rw-r--r--arch/arm/mach-mx3/devices.h3
-rw-r--r--arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c6
-rw-r--r--arch/arm/mach-mx3/mach-mx31ads.c2
-rw-r--r--arch/arm/mach-mx3/mach-pcm043.c5
8 files changed, 18 insertions, 54 deletions
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 5cee1a5c4bd2..d762bf8e539b 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -17,6 +17,7 @@ config MACH_MX31ADS
17 bool "Support MX31ADS platforms" 17 bool "Support MX31ADS platforms"
18 select ARCH_MX31 18 select ARCH_MX31
19 select IMX_HAVE_PLATFORM_IMX_I2C 19 select IMX_HAVE_PLATFORM_IMX_I2C
20 select IMX_HAVE_PLATFORM_IMX_SSI
20 select IMX_HAVE_PLATFORM_IMX_UART 21 select IMX_HAVE_PLATFORM_IMX_UART
21 default y 22 default y
22 help 23 help
@@ -118,6 +119,7 @@ config MACH_PCM043
118 bool "Support Phytec pcm043 (i.MX35) platforms" 119 bool "Support Phytec pcm043 (i.MX35) platforms"
119 select ARCH_MX35 120 select ARCH_MX35
120 select IMX_HAVE_PLATFORM_IMX_I2C 121 select IMX_HAVE_PLATFORM_IMX_I2C
122 select IMX_HAVE_PLATFORM_IMX_SSI
121 select IMX_HAVE_PLATFORM_IMX_UART 123 select IMX_HAVE_PLATFORM_IMX_UART
122 select IMX_HAVE_PLATFORM_MXC_NAND 124 select IMX_HAVE_PLATFORM_MXC_NAND
123 select IMX_HAVE_PLATFORM_FLEXCAN 125 select IMX_HAVE_PLATFORM_FLEXCAN
@@ -172,8 +174,8 @@ choice
172 default MACH_EUKREA_MBIMXSD35_BASEBOARD 174 default MACH_EUKREA_MBIMXSD35_BASEBOARD
173 175
174config MACH_EUKREA_MBIMXSD35_BASEBOARD 176config MACH_EUKREA_MBIMXSD35_BASEBOARD
175 prompt "Eukrea MBIMXSD development board" 177 bool "Eukrea MBIMXSD development board"
176 bool 178 select IMX_HAVE_PLATFORM_IMX_SSI
177 help 179 help
178 This adds board specific devices that can be found on Eukrea's 180 This adds board specific devices that can be found on Eukrea's
179 MBIMXSD evaluation board. 181 MBIMXSD evaluation board.
diff --git a/arch/arm/mach-mx3/devices-imx31.h b/arch/arm/mach-mx3/devices-imx31.h
index a8c5f1bfce3b..b8568a1af81d 100644
--- a/arch/arm/mach-mx3/devices-imx31.h
+++ b/arch/arm/mach-mx3/devices-imx31.h
@@ -16,6 +16,10 @@
16#define imx31_add_imx_i2c2(pdata) \ 16#define imx31_add_imx_i2c2(pdata) \
17 imx_add_imx_i2c(2, MX31_I2C3_BASE_ADDR, SZ_4K, MX31_INT_I2C3, pdata) 17 imx_add_imx_i2c(2, MX31_I2C3_BASE_ADDR, SZ_4K, MX31_INT_I2C3, pdata)
18 18
19extern const struct imx_imx_ssi_data imx31_imx_ssi_data[] __initconst;
20#define imx31_add_imx_ssi(id, pdata) \
21 imx_add_imx_ssi(&imx31_imx_ssi_data[id], pdata)
22
19extern const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst; 23extern const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst;
20#define imx31_add_imx_uart(id, pdata) \ 24#define imx31_add_imx_uart(id, pdata) \
21 imx_add_imx_uart_1irq(&imx31_imx_uart_data[id], pdata) 25 imx_add_imx_uart_1irq(&imx31_imx_uart_data[id], pdata)
diff --git a/arch/arm/mach-mx3/devices-imx35.h b/arch/arm/mach-mx3/devices-imx35.h
index 6a76b4d72e49..813e570fd3ba 100644
--- a/arch/arm/mach-mx3/devices-imx35.h
+++ b/arch/arm/mach-mx3/devices-imx35.h
@@ -21,6 +21,10 @@
21#define imx35_add_imx_i2c2(pdata) \ 21#define imx35_add_imx_i2c2(pdata) \
22 imx_add_imx_i2c(2, MX35_I2C3_BASE_ADDR, SZ_4K, MX35_INT_I2C3, pdata) 22 imx_add_imx_i2c(2, MX35_I2C3_BASE_ADDR, SZ_4K, MX35_INT_I2C3, pdata)
23 23
24extern const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst;
25#define imx35_add_imx_ssi(id, pdata) \
26 imx_add_imx_ssi(&imx35_imx_ssi_data[id], pdata)
27
24extern const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst; 28extern const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst;
25#define imx35_add_imx_uart(id, pdata) \ 29#define imx35_add_imx_uart(id, pdata) \
26 imx_add_imx_uart_1irq(&imx35_imx_uart_data[id], pdata) 30 imx_add_imx_uart_1irq(&imx35_imx_uart_data[id], pdata)
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index a4fd1a26fc91..87a9a21457b9 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -302,44 +302,6 @@ struct platform_device mxc_fec_device = {
302}; 302};
303#endif 303#endif
304 304
305static struct resource imx_ssi_resources0[] = {
306 {
307 .start = SSI1_BASE_ADDR,
308 .end = SSI1_BASE_ADDR + 0xfff,
309 .flags = IORESOURCE_MEM,
310 }, {
311 .start = MX31_INT_SSI1,
312 .end = MX31_INT_SSI1,
313 .flags = IORESOURCE_IRQ,
314 },
315};
316
317static struct resource imx_ssi_resources1[] = {
318 {
319 .start = SSI2_BASE_ADDR,
320 .end = SSI2_BASE_ADDR + 0xfff,
321 .flags = IORESOURCE_MEM
322 }, {
323 .start = MX31_INT_SSI2,
324 .end = MX31_INT_SSI2,
325 .flags = IORESOURCE_IRQ,
326 },
327};
328
329struct platform_device imx_ssi_device0 = {
330 .name = "imx-ssi",
331 .id = 0,
332 .num_resources = ARRAY_SIZE(imx_ssi_resources0),
333 .resource = imx_ssi_resources0,
334};
335
336struct platform_device imx_ssi_device1 = {
337 .name = "imx-ssi",
338 .id = 1,
339 .num_resources = ARRAY_SIZE(imx_ssi_resources1),
340 .resource = imx_ssi_resources1,
341};
342
343static struct resource imx_wdt_resources[] = { 305static struct resource imx_wdt_resources[] = {
344 { 306 {
345 .flags = IORESOURCE_MEM, 307 .flags = IORESOURCE_MEM,
@@ -410,10 +372,6 @@ static int __init mx3_devices_init(void)
410 mxc_usbh1_resources[0].end = MX35_OTG_BASE_ADDR + 0x5ff; 372 mxc_usbh1_resources[0].end = MX35_OTG_BASE_ADDR + 0x5ff;
411 mxc_usbh1_resources[1].start = MXC_INT_USBHS; 373 mxc_usbh1_resources[1].start = MXC_INT_USBHS;
412 mxc_usbh1_resources[1].end = MXC_INT_USBHS; 374 mxc_usbh1_resources[1].end = MXC_INT_USBHS;
413 imx_ssi_resources0[1].start = MX35_INT_SSI1;
414 imx_ssi_resources0[1].end = MX35_INT_SSI1;
415 imx_ssi_resources1[1].start = MX35_INT_SSI2;
416 imx_ssi_resources1[1].end = MX35_INT_SSI2;
417 imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR; 375 imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR;
418 imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff; 376 imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff;
419 } 377 }
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index e5535234839f..2a69465bc542 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -10,9 +10,6 @@ extern struct platform_device mxc_otg_host;
10extern struct platform_device mxc_usbh1; 10extern struct platform_device mxc_usbh1;
11extern struct platform_device mxc_usbh2; 11extern struct platform_device mxc_usbh2;
12extern struct platform_device mxc_rnga_device; 12extern struct platform_device mxc_rnga_device;
13extern struct platform_device imx_ssi_device0;
14extern struct platform_device imx_ssi_device1;
15extern struct platform_device imx_ssi_device1;
16extern struct platform_device imx_wdt_device0; 13extern struct platform_device imx_wdt_device0;
17extern struct platform_device imx_rtc_device0; 14extern struct platform_device imx_rtc_device0;
18extern struct platform_device imx_kpp_device; 15extern struct platform_device imx_kpp_device;
diff --git a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c
index f8f15e3ac7a0..cb667b6f17ae 100644
--- a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c
+++ b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c
@@ -43,7 +43,6 @@
43#include <mach/ipu.h> 43#include <mach/ipu.h>
44#include <mach/mx3fb.h> 44#include <mach/mx3fb.h>
45#include <mach/audmux.h> 45#include <mach/audmux.h>
46#include <mach/ssi.h>
47 46
48#include "devices-imx35.h" 47#include "devices-imx35.h"
49#include "devices.h" 48#include "devices.h"
@@ -206,7 +205,8 @@ static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = {
206 }, 205 },
207}; 206};
208 207
209struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata = { 208static const
209struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata __initconst = {
210 .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE, 210 .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE,
211}; 211};
212 212
@@ -242,7 +242,7 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
242 mxc_register_device(&mx3_ipu, &mx3_ipu_data); 242 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
243 mxc_register_device(&mx3_fb, &mx3fb_pdata); 243 mxc_register_device(&mx3_fb, &mx3fb_pdata);
244 244
245 mxc_register_device(&imx_ssi_device0, &eukrea_mbimxsd_ssi_pdata); 245 imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata);
246 246
247 gpio_request(GPIO_LED1, "LED1"); 247 gpio_request(GPIO_LED1, "LED1");
248 gpio_direction_output(GPIO_LED1, 1); 248 gpio_direction_output(GPIO_LED1, 1);
diff --git a/arch/arm/mach-mx3/mach-mx31ads.c b/arch/arm/mach-mx3/mach-mx31ads.c
index 94b3e7c42404..96cedc4a47f5 100644
--- a/arch/arm/mach-mx3/mach-mx31ads.c
+++ b/arch/arm/mach-mx3/mach-mx31ads.c
@@ -517,7 +517,7 @@ static unsigned int ssi_pins[] = {
517 517
518static void mxc_init_audio(void) 518static void mxc_init_audio(void)
519{ 519{
520 mxc_register_device(&imx_ssi_device0, NULL); 520 imx31_add_imx_ssi(0, NULL);
521 mxc_iomux_setup_multiple_pins(ssi_pins, ARRAY_SIZE(ssi_pins), "ssi"); 521 mxc_iomux_setup_multiple_pins(ssi_pins, ARRAY_SIZE(ssi_pins), "ssi");
522} 522}
523 523
diff --git a/arch/arm/mach-mx3/mach-pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c
index 28886f0e62f9..dcc216bb3952 100644
--- a/arch/arm/mach-mx3/mach-pcm043.c
+++ b/arch/arm/mach-mx3/mach-pcm043.c
@@ -42,7 +42,6 @@
42#include <mach/mxc_ehci.h> 42#include <mach/mxc_ehci.h>
43#include <mach/ulpi.h> 43#include <mach/ulpi.h>
44#include <mach/audmux.h> 44#include <mach/audmux.h>
45#include <mach/ssi.h>
46 45
47#include "devices-imx35.h" 46#include "devices-imx35.h"
48#include "devices.h" 47#include "devices.h"
@@ -293,7 +292,7 @@ err1:
293 mdelay(1); 292 mdelay(1);
294} 293}
295 294
296static struct imx_ssi_platform_data pcm043_ssi_pdata = { 295static const struct imx_ssi_platform_data pcm043_ssi_pdata __initconst = {
297 .ac97_reset = pcm043_ac97_cold_reset, 296 .ac97_reset = pcm043_ac97_cold_reset,
298 .ac97_warm_reset = pcm043_ac97_warm_reset, 297 .ac97_warm_reset = pcm043_ac97_warm_reset,
299 .flags = IMX_SSI_USE_AC97, 298 .flags = IMX_SSI_USE_AC97,
@@ -361,7 +360,7 @@ static void __init mxc_board_init(void)
361 360
362 imx35_add_imx_uart0(&uart_pdata); 361 imx35_add_imx_uart0(&uart_pdata);
363 imx35_add_mxc_nand(&pcm037_nand_board_info); 362 imx35_add_mxc_nand(&pcm037_nand_board_info);
364 mxc_register_device(&imx_ssi_device0, &pcm043_ssi_pdata); 363 imx35_add_imx_ssi(0, &pcm043_ssi_pdata);
365 364
366 imx35_add_imx_uart1(&uart_pdata); 365 imx35_add_imx_uart1(&uart_pdata);
367 366