summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-21 17:27:22 +0200
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-30 09:00:46 +0200
commit642e466bf405ba558e68353cd4ae6e8ed640b123 (patch)
tree01d1123c2972fe197d7f8baae612c68b7d1a507b /arch/arm/mach-imx
parent0287073713d2d638bd89aff53750467af657da63 (diff)
downloadlinux-3.10-642e466bf405ba558e68353cd4ae6e8ed640b123.tar.gz
linux-3.10-642e466bf405ba558e68353cd4ae6e8ed640b123.tar.bz2
linux-3.10-642e466bf405ba558e68353cd4ae6e8ed640b123.zip
ARM: imx: dynamically register spi_imx devices (imx21)
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/devices-imx21.h5
-rw-r--r--arch/arm/mach-imx/devices.c3
-rw-r--r--arch/arm/mach-imx/devices.h2
3 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/mach-imx/devices-imx21.h b/arch/arm/mach-imx/devices-imx21.h
index c6e5f50a729..de80ccd6f74 100644
--- a/arch/arm/mach-imx/devices-imx21.h
+++ b/arch/arm/mach-imx/devices-imx21.h
@@ -14,3 +14,8 @@
#define imx21_add_mxc_nand(pdata) \
imx_add_mxc_nand_v1(MX21_NFC_BASE_ADDR, MX21_INT_NANDFC, pdata)
+
+#define imx21_add_spi_imx0(pdata) \
+ imx_add_spi_imx(0, MX21_CSPI1_BASE_ADDR, SZ_4K, MX21_INT_CSPI1, pdata)
+#define imx21_add_spi_imx1(pdata) \
+ imx_add_spi_imx(1, MX21_CSPI2_BASE_ADDR, SZ_4K, MX21_INT_CSPI2, pdata)
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c
index f8641c2c905..e42eead9dd9 100644
--- a/arch/arm/mach-imx/devices.c
+++ b/arch/arm/mach-imx/devices.c
@@ -225,6 +225,7 @@ int __init imx1_register_gpios(void)
* - i.MX21: 2 channel
* - i.MX27: 3 channel
*/
+#ifdef CONFIG_MACH_MX27
#define DEFINE_IMX_SPI_DEVICE(n, baseaddr, irq) \
static struct resource mxc_spi_resources ## n[] = { \
{ \
@@ -247,8 +248,6 @@ int __init imx1_register_gpios(void)
DEFINE_IMX_SPI_DEVICE(0, MX2x_CSPI1_BASE_ADDR, MX2x_INT_CSPI1);
DEFINE_IMX_SPI_DEVICE(1, MX2x_CSPI2_BASE_ADDR, MX2x_INT_CSPI2);
-
-#ifdef CONFIG_MACH_MX27
DEFINE_IMX_SPI_DEVICE(2, MX27_CSPI3_BASE_ADDR, MX27_INT_CSPI3);
#endif
diff --git a/arch/arm/mach-imx/devices.h b/arch/arm/mach-imx/devices.h
index 4fe99354f22..c15b0de42d6 100644
--- a/arch/arm/mach-imx/devices.h
+++ b/arch/arm/mach-imx/devices.h
@@ -34,9 +34,9 @@ extern struct platform_device mxc_otg_udc_device;
extern struct platform_device mxc_otg_host;
extern struct platform_device mxc_usbh1;
extern struct platform_device mxc_usbh2;
+#ifdef CONFIG_MACH_MX27
extern struct platform_device mxc_spi_device0;
extern struct platform_device mxc_spi_device1;
-#ifdef CONFIG_MACH_MX27
extern struct platform_device mxc_spi_device2;
#endif
extern struct platform_device mx21_usbhc_device;