aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-02 12:50:55 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-17 04:01:24 -0500
commitb2997cb12b302ee6d233808e32214d00afdcf128 (patch)
treee9c7896465e257f72846fb0c5b89ed33fb8593ec /arch/arm/plat-mxc
parent3bde75b5370bd69fd7f07a8e254bef05b1b5b219 (diff)
ARM: imx: dynamically allocate mx2-camera device
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/Kconfig3
-rw-r--r--arch/arm/plat-mxc/devices/Makefile1
-rw-r--r--arch/arm/plat-mxc/devices/platform-mx2-camera.c53
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h13
-rw-r--r--arch/arm/plat-mxc/include/mach/mx27.h4
5 files changed, 72 insertions, 2 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
index 61a3e25cada6..37d7e001d72c 100644
--- a/arch/arm/plat-mxc/devices/Kconfig
+++ b/arch/arm/plat-mxc/devices/Kconfig
@@ -28,6 +28,9 @@ config IMX_HAVE_PLATFORM_IMX_UDC
28config IMX_HAVE_PLATFORM_MX1_CAMERA 28config IMX_HAVE_PLATFORM_MX1_CAMERA
29 bool 29 bool
30 30
31config IMX_HAVE_PLATFORM_MX2_CAMERA
32 bool
33
31config IMX_HAVE_PLATFORM_MXC_NAND 34config IMX_HAVE_PLATFORM_MXC_NAND
32 bool 35 bool
33 36
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile
index 86b47f2b610e..88392fc47c0a 100644
--- a/arch/arm/plat-mxc/devices/Makefile
+++ b/arch/arm/plat-mxc/devices/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o
8obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o 8obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o
9obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o 9obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o
10obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o 10obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o
11obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o
11obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o 12obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o
12obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o 13obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o
13obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o 14obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o
diff --git a/arch/arm/plat-mxc/devices/platform-mx2-camera.c b/arch/arm/plat-mxc/devices/platform-mx2-camera.c
new file mode 100644
index 000000000000..a18c80355de0
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-mx2-camera.c
@@ -0,0 +1,53 @@
1/*
2 * Copyright (C) 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 <mach/hardware.h>
10#include <mach/devices-common.h>
11
12#define imx_mx2_camera_data_entry_single(soc) \
13 { \
14 .iobasecsi = soc ## _CSI_BASE_ADDR, \
15 .iosizecsi = SZ_32, \
16 .irqcsi = soc ## _INT_CSI, \
17 .iobaseemmaprp = soc ## _EMMAPRP_BASE_ADDR, \
18 .iosizeemmaprp = SZ_32, \
19 .irqemmaprp = soc ## _INT_EMMAPRP, \
20 }
21
22#ifdef CONFIG_SOC_IMX27
23const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
24 imx_mx2_camera_data_entry_single(MX27);
25#endif /* ifdef CONFIG_SOC_IMX27 */
26
27struct platform_device *__init imx_add_mx2_camera(
28 const struct imx_mx2_camera_data *data,
29 const struct mx2_camera_platform_data *pdata)
30{
31 struct resource res[] = {
32 {
33 .start = data->iobasecsi,
34 .end = data->iobasecsi + data->iosizecsi - 1,
35 .flags = IORESOURCE_MEM,
36 }, {
37 .start = data->iobaseemmaprp,
38 .end = data->iobaseemmaprp + data->iosizeemmaprp - 1,
39 .flags = IORESOURCE_MEM,
40 }, {
41 .start = data->irqcsi,
42 .end = data->irqcsi,
43 .flags = IORESOURCE_IRQ,
44 }, {
45 .start = data->irqemmaprp,
46 .end = data->irqemmaprp,
47 .flags = IORESOURCE_IRQ,
48 },
49 };
50 return imx_add_platform_device_dmamask("mx2-camera", 0,
51 res, ARRAY_SIZE(res),
52 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
53}
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index ab0500a7b5e7..e31fc50384c8 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -118,6 +118,19 @@ struct platform_device *__init imx_add_mx1_camera(
118 const struct imx_mx1_camera_data *data, 118 const struct imx_mx1_camera_data *data,
119 const struct mx1_camera_pdata *pdata); 119 const struct mx1_camera_pdata *pdata);
120 120
121#include <mach/mx2_cam.h>
122struct imx_mx2_camera_data {
123 resource_size_t iobasecsi;
124 resource_size_t iosizecsi;
125 resource_size_t irqcsi;
126 resource_size_t iobaseemmaprp;
127 resource_size_t iosizeemmaprp;
128 resource_size_t irqemmaprp;
129};
130struct platform_device *__init imx_add_mx2_camera(
131 const struct imx_mx2_camera_data *data,
132 const struct mx2_camera_platform_data *pdata);
133
121#include <mach/mxc_nand.h> 134#include <mach/mxc_nand.h>
122struct imx_mxc_nand_data { 135struct imx_mxc_nand_data {
123 /* 136 /*
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h
index 3116b3b3d83e..2734d24e8e1c 100644
--- a/arch/arm/plat-mxc/include/mach/mx27.h
+++ b/arch/arm/plat-mxc/include/mach/mx27.h
@@ -67,8 +67,8 @@
67#define MX27_USBOTG_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x24000) 67#define MX27_USBOTG_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x24000)
68#define MX27_OTG_BASE_ADDR MX27_USBOTG_BASE_ADDR 68#define MX27_OTG_BASE_ADDR MX27_USBOTG_BASE_ADDR
69#define MX27_SAHARA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x25000) 69#define MX27_SAHARA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x25000)
70#define MX27_EMMA_PP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26000) 70#define MX27_EMMAPP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26000)
71#define MX27_EMMA_PRP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26400) 71#define MX27_EMMAPRP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26400)
72#define MX27_CCM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x27000) 72#define MX27_CCM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x27000)
73#define MX27_SYSCTRL_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x27800) 73#define MX27_SYSCTRL_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x27800)
74#define MX27_IIM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x28000) 74#define MX27_IIM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x28000)