aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-22 04:14:15 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-30 03:00:51 -0400
commita4dc013570e08ec4947b10fa78080da767b30527 (patch)
tree26029462e20eacfdc5480e41b15faf0ccbc491a8
parent06606ff1300ecb05a2a2953c9f735730950365f5 (diff)
ARM: imx: dynamically register spi_imx devices (imx35)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r--arch/arm/mach-mx3/Kconfig1
-rw-r--r--arch/arm/mach-mx3/devices-imx35.h5
-rw-r--r--arch/arm/mach-mx3/devices.c61
-rw-r--r--arch/arm/mach-mx3/devices.h5
-rw-r--r--arch/arm/mach-mx3/mach-pcm037_eet.c7
5 files changed, 8 insertions, 71 deletions
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 60d58a62906..a8018e8edb0 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -45,6 +45,7 @@ config MACH_PCM037
45config MACH_PCM037_EET 45config MACH_PCM037_EET
46 bool "Support pcm037 EET board extensions" 46 bool "Support pcm037 EET board extensions"
47 depends on MACH_PCM037 47 depends on MACH_PCM037
48 select IMX_HAVE_PLATFORM_SPI_IMX
48 help 49 help
49 Add support for PCM037 EET baseboard extensions. If you are using the 50 Add support for PCM037 EET baseboard extensions. If you are using the
50 OLED display with EET, use "video=mx3fb:CMEL-OLED" kernel 51 OLED display with EET, use "video=mx3fb:CMEL-OLED" kernel
diff --git a/arch/arm/mach-mx3/devices-imx35.h b/arch/arm/mach-mx3/devices-imx35.h
index 6d993ae1d05..b595fa641ee 100644
--- a/arch/arm/mach-mx3/devices-imx35.h
+++ b/arch/arm/mach-mx3/devices-imx35.h
@@ -18,3 +18,8 @@
18 18
19#define imx35_add_mxc_nand(pdata) \ 19#define imx35_add_mxc_nand(pdata) \
20 imx_add_mxc_nand_v21(MX35_NFC_BASE_ADDR, MX35_INT_NANDFC, pdata) 20 imx_add_mxc_nand_v21(MX35_NFC_BASE_ADDR, MX35_INT_NANDFC, pdata)
21
22#define imx35_add_spi_imx0(pdata) \
23 imx_add_spi_imx(0, MX35_CSPI1_BASE_ADDR, SZ_4K, MX35_INT_CSPI1, pdata)
24#define imx35_add_spi_imx1(pdata) \
25 imx_add_spi_imx(1, MX35_CSPI2_BASE_ADDR, SZ_4K, MX35_INT_CSPI2, pdata)
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index 02d05ea7036..dd90ee9a0d6 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -380,67 +380,6 @@ struct platform_device mxc_usbh2 = {
380}; 380};
381 381
382#if defined(CONFIG_ARCH_MX35) 382#if defined(CONFIG_ARCH_MX35)
383/*
384 * SPI master controller
385 * 3 channels
386 */
387static struct resource mxc_spi_0_resources[] = {
388 {
389 .start = CSPI1_BASE_ADDR,
390 .end = CSPI1_BASE_ADDR + SZ_4K - 1,
391 .flags = IORESOURCE_MEM,
392 }, {
393 .start = MXC_INT_CSPI1,
394 .end = MXC_INT_CSPI1,
395 .flags = IORESOURCE_IRQ,
396 },
397};
398
399static struct resource mxc_spi_1_resources[] = {
400 {
401 .start = CSPI2_BASE_ADDR,
402 .end = CSPI2_BASE_ADDR + SZ_4K - 1,
403 .flags = IORESOURCE_MEM,
404 }, {
405 .start = MXC_INT_CSPI2,
406 .end = MXC_INT_CSPI2,
407 .flags = IORESOURCE_IRQ,
408 },
409};
410
411static struct resource mxc_spi_2_resources[] = {
412 {
413 .start = CSPI3_BASE_ADDR,
414 .end = CSPI3_BASE_ADDR + SZ_4K - 1,
415 .flags = IORESOURCE_MEM,
416 }, {
417 .start = MXC_INT_CSPI3,
418 .end = MXC_INT_CSPI3,
419 .flags = IORESOURCE_IRQ,
420 },
421};
422
423struct platform_device mxc_spi_device0 = {
424 .name = "spi_imx",
425 .id = 0,
426 .num_resources = ARRAY_SIZE(mxc_spi_0_resources),
427 .resource = mxc_spi_0_resources,
428};
429
430struct platform_device mxc_spi_device1 = {
431 .name = "spi_imx",
432 .id = 1,
433 .num_resources = ARRAY_SIZE(mxc_spi_1_resources),
434 .resource = mxc_spi_1_resources,
435};
436
437struct platform_device mxc_spi_device2 = {
438 .name = "spi_imx",
439 .id = 2,
440 .num_resources = ARRAY_SIZE(mxc_spi_2_resources),
441 .resource = mxc_spi_2_resources,
442};
443
444static struct resource mxc_fec_resources[] = { 383static struct resource mxc_fec_resources[] = {
445 { 384 {
446 .start = MXC_FEC_BASE_ADDR, 385 .start = MXC_FEC_BASE_ADDR,
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index d22a32730c9..9380cd99827 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -16,11 +16,6 @@ extern struct platform_device mxc_otg_host;
16extern struct platform_device mxc_usbh1; 16extern struct platform_device mxc_usbh1;
17extern struct platform_device mxc_usbh2; 17extern struct platform_device mxc_usbh2;
18extern struct platform_device mxc_rnga_device; 18extern struct platform_device mxc_rnga_device;
19#if defined(CONFIG_ARCH_MX35)
20extern struct platform_device mxc_spi_device0;
21extern struct platform_device mxc_spi_device1;
22extern struct platform_device mxc_spi_device2;
23#endif
24extern struct platform_device imx_ssi_device0; 19extern struct platform_device imx_ssi_device0;
25extern struct platform_device imx_ssi_device1; 20extern struct platform_device imx_ssi_device1;
26extern struct platform_device imx_ssi_device1; 21extern struct platform_device imx_ssi_device1;
diff --git a/arch/arm/mach-mx3/mach-pcm037_eet.c b/arch/arm/mach-mx3/mach-pcm037_eet.c
index 8d386000fc4..c8b98218efe 100644
--- a/arch/arm/mach-mx3/mach-pcm037_eet.c
+++ b/arch/arm/mach-mx3/mach-pcm037_eet.c
@@ -13,9 +13,6 @@
13#include <linux/spi/spi.h> 13#include <linux/spi/spi.h>
14 14
15#include <mach/common.h> 15#include <mach/common.h>
16#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
17#include <mach/spi.h>
18#endif
19#include <mach/iomux-mx3.h> 16#include <mach/iomux-mx3.h>
20 17
21#include <asm/mach-types.h> 18#include <asm/mach-types.h>
@@ -64,7 +61,7 @@ static struct spi_board_info pcm037_spi_dev[] = {
64#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) 61#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
65static int pcm037_spi1_cs[] = {MXC_SPI_CS(1), IOMUX_TO_GPIO(MX31_PIN_KEY_COL7)}; 62static int pcm037_spi1_cs[] = {MXC_SPI_CS(1), IOMUX_TO_GPIO(MX31_PIN_KEY_COL7)};
66 63
67struct spi_imx_master pcm037_spi1_master = { 64static const struct spi_imx_master pcm037_spi1_pdata __initconst = {
68 .chipselect = pcm037_spi1_cs, 65 .chipselect = pcm037_spi1_cs,
69 .num_chipselect = ARRAY_SIZE(pcm037_spi1_cs), 66 .num_chipselect = ARRAY_SIZE(pcm037_spi1_cs),
70}; 67};
@@ -184,7 +181,7 @@ static int eet_init_devices(void)
184 /* SPI */ 181 /* SPI */
185 spi_register_board_info(pcm037_spi_dev, ARRAY_SIZE(pcm037_spi_dev)); 182 spi_register_board_info(pcm037_spi_dev, ARRAY_SIZE(pcm037_spi_dev));
186#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) 183#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
187 mxc_register_device(&mxc_spi_device0, &pcm037_spi1_master); 184 imx35_add_spi_imx0(&pcm037_spi1_pdata);
188#endif 185#endif
189 186
190 platform_device_register(&pcm037_gpio_keys_device); 187 platform_device_register(&pcm037_gpio_keys_device);