aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-21 12:02:55 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-30 03:00:45 -0400
commit0287073713d2d638bd89aff53750467af657da63 (patch)
tree3627f35d247de031cabfe443d19bc09db3d71f27
parent7cdc8fa7120f97f40d36547854ae127dc0318e3a (diff)
ARM: imx: dynamically register spi_imx devices (generic part)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r--arch/arm/plat-mxc/devices/Kconfig3
-rw-r--r--arch/arm/plat-mxc/devices/Makefile1
-rw-r--r--arch/arm/plat-mxc/devices/platform-spi_imx.c30
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h5
4 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
index c50a7d60a0bc..166c0c88354a 100644
--- a/arch/arm/plat-mxc/devices/Kconfig
+++ b/arch/arm/plat-mxc/devices/Kconfig
@@ -3,3 +3,6 @@ config IMX_HAVE_PLATFORM_IMX_I2C
3 3
4config IMX_HAVE_PLATFORM_MXC_NAND 4config IMX_HAVE_PLATFORM_MXC_NAND
5 bool 5 bool
6
7config IMX_HAVE_PLATFORM_SPI_IMX
8 bool
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile
index 4a2b2dec131e..ceb6a4245950 100644
--- a/arch/arm/plat-mxc/devices/Makefile
+++ b/arch/arm/plat-mxc/devices/Makefile
@@ -1,2 +1,3 @@
1obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o 1obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o
2obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o 2obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o
3obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o
diff --git a/arch/arm/plat-mxc/devices/platform-spi_imx.c b/arch/arm/plat-mxc/devices/platform-spi_imx.c
new file mode 100644
index 000000000000..2831a6d3eb4b
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-spi_imx.c
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include <asm/sizes.h>
10#include <mach/devices-common.h>
11
12struct platform_device *__init imx_add_spi_imx(int id,
13 resource_size_t iobase, resource_size_t iosize, int irq,
14 const struct spi_imx_master *pdata)
15{
16 struct resource res[] = {
17 {
18 .start = iobase,
19 .end = iobase + iosize - 1,
20 .flags = IORESOURCE_MEM,
21 }, {
22 .start = irq,
23 .end = irq,
24 .flags = IORESOURCE_IRQ,
25 },
26 };
27
28 return imx_add_platform_device("spi_imx", id, res, ARRAY_SIZE(res),
29 pdata, sizeof(*pdata));
30}
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index 8388f9086e68..f67df8718b08 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -24,3 +24,8 @@ struct platform_device *__init imx_add_mxc_nand_v1(resource_size_t iobase,
24 int irq, const struct mxc_nand_platform_data *pdata); 24 int irq, const struct mxc_nand_platform_data *pdata);
25struct platform_device *__init imx_add_mxc_nand_v21(resource_size_t iobase, 25struct platform_device *__init imx_add_mxc_nand_v21(resource_size_t iobase,
26 int irq, const struct mxc_nand_platform_data *pdata); 26 int irq, const struct mxc_nand_platform_data *pdata);
27
28#include <mach/spi.h>
29struct platform_device *__init imx_add_spi_imx(int id,
30 resource_size_t iobase, resource_size_t iosize, int irq,
31 const struct spi_imx_master *pdata);