diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-06-21 12:02:55 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-06-30 03:00:45 -0400 |
commit | 0287073713d2d638bd89aff53750467af657da63 (patch) | |
tree | 3627f35d247de031cabfe443d19bc09db3d71f27 /arch/arm/plat-mxc | |
parent | 7cdc8fa7120f97f40d36547854ae127dc0318e3a (diff) |
ARM: imx: dynamically register spi_imx devices (generic part)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r-- | arch/arm/plat-mxc/devices/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-spi_imx.c | 30 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/devices-common.h | 5 |
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 | ||
4 | config IMX_HAVE_PLATFORM_MXC_NAND | 4 | config IMX_HAVE_PLATFORM_MXC_NAND |
5 | bool | 5 | bool |
6 | |||
7 | config 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 @@ | |||
1 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o | 1 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o |
2 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o | 2 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o |
3 | obj-$(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 | |||
12 | struct 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); |
25 | struct platform_device *__init imx_add_mxc_nand_v21(resource_size_t iobase, | 25 | struct 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> | ||
29 | struct 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); | ||