diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-08-25 11:37:45 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-09-27 09:46:38 -0400 |
commit | 4697bb926f43b8012ebd111ef43834f42126a0ef (patch) | |
tree | bd913f4f8ea631e50aff81b18cec211f5b7ddc91 /arch/arm/mach-imx | |
parent | 5162de08d116fe7bbb912b17d84169983bfa16a8 (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-imx')
-rw-r--r-- | arch/arm/mach-imx/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices-imx21.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices-imx27.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices.c | 35 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-pca100.c | 5 |
7 files changed, 16 insertions, 45 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 19ed16d0017e..9b45f1f523fa 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
@@ -146,8 +146,8 @@ choice | |||
146 | default MACH_EUKREA_MBIMX27_BASEBOARD | 146 | default MACH_EUKREA_MBIMX27_BASEBOARD |
147 | 147 | ||
148 | config MACH_EUKREA_MBIMX27_BASEBOARD | 148 | config MACH_EUKREA_MBIMX27_BASEBOARD |
149 | prompt "Eukrea MBIMX27 development board" | 149 | bool "Eukrea MBIMX27 development board" |
150 | bool | 150 | select IMX_HAVE_PLATFORM_IMX_SSI |
151 | select IMX_HAVE_PLATFORM_IMX_UART | 151 | select IMX_HAVE_PLATFORM_IMX_UART |
152 | select IMX_HAVE_PLATFORM_SPI_IMX | 152 | select IMX_HAVE_PLATFORM_SPI_IMX |
153 | help | 153 | help |
@@ -182,6 +182,7 @@ config MACH_IMX27LITE | |||
182 | config MACH_PCA100 | 182 | config MACH_PCA100 |
183 | bool "Phytec phyCARD-s (pca100)" | 183 | bool "Phytec phyCARD-s (pca100)" |
184 | select IMX_HAVE_PLATFORM_IMX_I2C | 184 | select IMX_HAVE_PLATFORM_IMX_I2C |
185 | select IMX_HAVE_PLATFORM_IMX_SSI | ||
185 | select IMX_HAVE_PLATFORM_IMX_UART | 186 | select IMX_HAVE_PLATFORM_IMX_UART |
186 | select IMX_HAVE_PLATFORM_MXC_NAND | 187 | select IMX_HAVE_PLATFORM_MXC_NAND |
187 | select IMX_HAVE_PLATFORM_SPI_IMX | 188 | select IMX_HAVE_PLATFORM_SPI_IMX |
diff --git a/arch/arm/mach-imx/devices-imx21.h b/arch/arm/mach-imx/devices-imx21.h index f75b5e4d0ed5..24868c36d824 100644 --- a/arch/arm/mach-imx/devices-imx21.h +++ b/arch/arm/mach-imx/devices-imx21.h | |||
@@ -12,6 +12,10 @@ | |||
12 | #define imx21_add_i2c_imx(pdata) \ | 12 | #define imx21_add_i2c_imx(pdata) \ |
13 | imx_add_imx_i2c(0, MX2x_I2C_BASE_ADDR, SZ_4K, MX2x_INT_I2C, pdata) | 13 | imx_add_imx_i2c(0, MX2x_I2C_BASE_ADDR, SZ_4K, MX2x_INT_I2C, pdata) |
14 | 14 | ||
15 | extern const struct imx_imx_ssi_data imx21_imx_ssi_data[] __initconst; | ||
16 | #define imx21_add_imx_ssi(id, pdata) \ | ||
17 | imx_add_imx_ssi(&imx21_imx_ssi_data[id], pdata) | ||
18 | |||
15 | extern const struct imx_imx_uart_1irq_data imx21_imx_uart_data[] __initconst; | 19 | extern const struct imx_imx_uart_1irq_data imx21_imx_uart_data[] __initconst; |
16 | #define imx21_add_imx_uart(id, pdata) \ | 20 | #define imx21_add_imx_uart(id, pdata) \ |
17 | imx_add_imx_uart_1irq(&imx21_imx_uart_data[id], pdata) | 21 | imx_add_imx_uart_1irq(&imx21_imx_uart_data[id], pdata) |
diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h index bf9dab3a0858..2972e6912af4 100644 --- a/arch/arm/mach-imx/devices-imx27.h +++ b/arch/arm/mach-imx/devices-imx27.h | |||
@@ -14,6 +14,10 @@ | |||
14 | #define imx27_add_i2c_imx1(pdata) \ | 14 | #define imx27_add_i2c_imx1(pdata) \ |
15 | imx_add_imx_i2c(1, MX27_I2C2_BASE_ADDR, SZ_4K, MX27_INT_I2C2, pdata) | 15 | imx_add_imx_i2c(1, MX27_I2C2_BASE_ADDR, SZ_4K, MX27_INT_I2C2, pdata) |
16 | 16 | ||
17 | extern const struct imx_imx_ssi_data imx27_imx_ssi_data[] __initconst; | ||
18 | #define imx27_add_imx_ssi(id, pdata) \ | ||
19 | imx_add_imx_ssi(&imx27_imx_ssi_data[id], pdata) | ||
20 | |||
17 | extern const struct imx_imx_uart_1irq_data imx27_imx_uart_data[] __initconst; | 21 | extern const struct imx_imx_uart_1irq_data imx27_imx_uart_data[] __initconst; |
18 | #define imx27_add_imx_uart(id, pdata) \ | 22 | #define imx27_add_imx_uart(id, pdata) \ |
19 | imx_add_imx_uart_1irq(&imx27_imx_uart_data[id], pdata) | 23 | imx_add_imx_uart_1irq(&imx27_imx_uart_data[id], pdata) |
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c index 9c271a752b84..423fa05dabd0 100644 --- a/arch/arm/mach-imx/devices.c +++ b/arch/arm/mach-imx/devices.c | |||
@@ -480,41 +480,6 @@ struct platform_device mxc_usbh2 = { | |||
480 | }; | 480 | }; |
481 | #endif | 481 | #endif |
482 | 482 | ||
483 | #define DEFINE_IMX_SSI_DMARES(_name, ssin, suffix) \ | ||
484 | { \ | ||
485 | .name = _name, \ | ||
486 | .start = MX2x_DMA_REQ_SSI ## ssin ## _ ## suffix, \ | ||
487 | .end = MX2x_DMA_REQ_SSI ## ssin ## _ ## suffix, \ | ||
488 | .flags = IORESOURCE_DMA, \ | ||
489 | } | ||
490 | |||
491 | #define DEFINE_IMX_SSI_DEVICE(n, ssin, baseaddr, irq) \ | ||
492 | static struct resource imx_ssi_resources ## n[] = { \ | ||
493 | { \ | ||
494 | .start = MX2x_SSI ## ssin ## _BASE_ADDR, \ | ||
495 | .end = MX2x_SSI ## ssin ## _BASE_ADDR + 0x6f, \ | ||
496 | .flags = IORESOURCE_MEM, \ | ||
497 | }, { \ | ||
498 | .start = MX2x_INT_SSI1, \ | ||
499 | .end = MX2x_INT_SSI1, \ | ||
500 | .flags = IORESOURCE_IRQ, \ | ||
501 | }, \ | ||
502 | DEFINE_IMX_SSI_DMARES("tx0", ssin, TX0), \ | ||
503 | DEFINE_IMX_SSI_DMARES("rx0", ssin, RX0), \ | ||
504 | DEFINE_IMX_SSI_DMARES("tx1", ssin, TX1), \ | ||
505 | DEFINE_IMX_SSI_DMARES("rx1", ssin, RX1), \ | ||
506 | }; \ | ||
507 | \ | ||
508 | struct platform_device imx_ssi_device ## n = { \ | ||
509 | .name = "imx-ssi", \ | ||
510 | .id = n, \ | ||
511 | .num_resources = ARRAY_SIZE(imx_ssi_resources ## n), \ | ||
512 | .resource = imx_ssi_resources ## n, \ | ||
513 | } | ||
514 | |||
515 | DEFINE_IMX_SSI_DEVICE(0, 1, MX2x_SSI1_BASE_ADDR, MX2x_INT_SSI1); | ||
516 | DEFINE_IMX_SSI_DEVICE(1, 2, MX2x_SSI1_BASE_ADDR, MX2x_INT_SSI1); | ||
517 | |||
518 | /* GPIO port description */ | 483 | /* GPIO port description */ |
519 | #define DEFINE_MXC_GPIO_PORT_IRQ(SOC, n, _irq) \ | 484 | #define DEFINE_MXC_GPIO_PORT_IRQ(SOC, n, _irq) \ |
520 | { \ | 485 | { \ |
diff --git a/arch/arm/mach-imx/devices.h b/arch/arm/mach-imx/devices.h index efd4527506a5..57d4b1cac039 100644 --- a/arch/arm/mach-imx/devices.h +++ b/arch/arm/mach-imx/devices.h | |||
@@ -26,7 +26,5 @@ extern struct platform_device mxc_otg_host; | |||
26 | extern struct platform_device mxc_usbh1; | 26 | extern struct platform_device mxc_usbh1; |
27 | extern struct platform_device mxc_usbh2; | 27 | extern struct platform_device mxc_usbh2; |
28 | extern struct platform_device mx21_usbhc_device; | 28 | extern struct platform_device mx21_usbhc_device; |
29 | extern struct platform_device imx_ssi_device0; | ||
30 | extern struct platform_device imx_ssi_device1; | ||
31 | extern struct platform_device imx_kpp_device; | 29 | extern struct platform_device imx_kpp_device; |
32 | #endif | 30 | #endif |
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c index 4edc5f439201..cb433aeec939 100644 --- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
37 | #include <mach/mmc.h> | 37 | #include <mach/mmc.h> |
38 | #include <mach/spi.h> | 38 | #include <mach/spi.h> |
39 | #include <mach/ssi.h> | ||
40 | #include <mach/audmux.h> | 39 | #include <mach/audmux.h> |
41 | 40 | ||
42 | #include "devices-imx27.h" | 41 | #include "devices-imx27.h" |
@@ -311,7 +310,8 @@ static struct imxmmc_platform_data sdhc_pdata = { | |||
311 | .dat3_card_detect = 1, | 310 | .dat3_card_detect = 1, |
312 | }; | 311 | }; |
313 | 312 | ||
314 | struct imx_ssi_platform_data eukrea_mbimx27_ssi_pdata = { | 313 | static const |
314 | struct imx_ssi_platform_data eukrea_mbimx27_ssi_pdata __initconst = { | ||
315 | .flags = IMX_SSI_DMA | IMX_SSI_USE_I2S_SLAVE, | 315 | .flags = IMX_SSI_DMA | IMX_SSI_USE_I2S_SLAVE, |
316 | }; | 316 | }; |
317 | 317 | ||
@@ -357,7 +357,7 @@ void __init eukrea_mbimx27_baseboard_init(void) | |||
357 | i2c_register_board_info(0, eukrea_mbimx27_i2c_devices, | 357 | i2c_register_board_info(0, eukrea_mbimx27_i2c_devices, |
358 | ARRAY_SIZE(eukrea_mbimx27_i2c_devices)); | 358 | ARRAY_SIZE(eukrea_mbimx27_i2c_devices)); |
359 | 359 | ||
360 | mxc_register_device(&imx_ssi_device0, &eukrea_mbimx27_ssi_pdata); | 360 | imx27_add_imx_ssi(0, &eukrea_mbimx27_ssi_pdata); |
361 | 361 | ||
362 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) \ | 362 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) \ |
363 | || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | 363 | || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) |
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c index 23c9e1f37b9c..93e0d66e37dc 100644 --- a/arch/arm/mach-imx/mach-pca100.c +++ b/arch/arm/mach-imx/mach-pca100.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include <mach/iomux-mx27.h> | 38 | #include <mach/iomux-mx27.h> |
39 | #include <asm/mach/time.h> | 39 | #include <asm/mach/time.h> |
40 | #include <mach/audmux.h> | 40 | #include <mach/audmux.h> |
41 | #include <mach/ssi.h> | ||
42 | #include <mach/mxc_nand.h> | 41 | #include <mach/mxc_nand.h> |
43 | #include <mach/irqs.h> | 42 | #include <mach/irqs.h> |
44 | #include <mach/mmc.h> | 43 | #include <mach/mmc.h> |
@@ -252,7 +251,7 @@ static void pca100_ac97_cold_reset(struct snd_ac97 *ac97) | |||
252 | msleep(2); | 251 | msleep(2); |
253 | } | 252 | } |
254 | 253 | ||
255 | static struct imx_ssi_platform_data pca100_ssi_pdata = { | 254 | static const struct imx_ssi_platform_data pca100_ssi_pdata __initconst = { |
256 | .ac97_reset = pca100_ac97_cold_reset, | 255 | .ac97_reset = pca100_ac97_cold_reset, |
257 | .ac97_warm_reset = pca100_ac97_warm_reset, | 256 | .ac97_warm_reset = pca100_ac97_warm_reset, |
258 | .flags = IMX_SSI_USE_AC97, | 257 | .flags = IMX_SSI_USE_AC97, |
@@ -389,7 +388,7 @@ static void __init pca100_init(void) | |||
389 | if (ret) | 388 | if (ret) |
390 | printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret); | 389 | printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret); |
391 | 390 | ||
392 | mxc_register_device(&imx_ssi_device0, &pca100_ssi_pdata); | 391 | imx27_add_imx_ssi(0, &pca100_ssi_pdata); |
393 | 392 | ||
394 | imx27_add_imx_uart0(&uart_pdata); | 393 | imx27_add_imx_uart0(&uart_pdata); |
395 | 394 | ||