diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-11 17:11:34 +0100 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-19 21:53:48 +0100 |
commit | bb4c853ff18fe3b0e2aec45053c318479e0c55e3 (patch) | |
tree | fd5a90eeacaf73be2d121ff1c5d3a9db2cb5e80b /arch/arm/plat-mxc/devices | |
parent | 00871505dcf15418aebc402db9f124dd2738fa2d (diff) |
ARM: mx25: dynamically allocate mx2-camera devices
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/devices')
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-mx2-camera.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/arch/arm/plat-mxc/devices/platform-mx2-camera.c b/arch/arm/plat-mxc/devices/platform-mx2-camera.c index a18c80355de..b3f4828dc44 100644 --- a/arch/arm/plat-mxc/devices/platform-mx2-camera.c +++ b/arch/arm/plat-mxc/devices/platform-mx2-camera.c @@ -12,6 +12,12 @@ #define imx_mx2_camera_data_entry_single(soc) \ { \ .iobasecsi = soc ## _CSI_BASE_ADDR, \ + .iosizecsi = SZ_4K, \ + .irqcsi = soc ## _INT_CSI, \ + } +#define imx_mx2_camera_data_entry_single_emma(soc) \ + { \ + .iobasecsi = soc ## _CSI_BASE_ADDR, \ .iosizecsi = SZ_32, \ .irqcsi = soc ## _INT_CSI, \ .iobaseemmaprp = soc ## _EMMAPRP_BASE_ADDR, \ @@ -19,9 +25,14 @@ .irqemmaprp = soc ## _INT_EMMAPRP, \ } +#ifdef CONFIG_SOC_IMX25 +const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst = + imx_mx2_camera_data_entry_single(MX25); +#endif /* ifdef CONFIG_SOC_IMX25 */ + #ifdef CONFIG_SOC_IMX27 const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst = - imx_mx2_camera_data_entry_single(MX27); + imx_mx2_camera_data_entry_single_emma(MX27); #endif /* ifdef CONFIG_SOC_IMX27 */ struct platform_device *__init imx_add_mx2_camera( @@ -34,20 +45,20 @@ struct platform_device *__init imx_add_mx2_camera( .end = data->iobasecsi + data->iosizecsi - 1, .flags = IORESOURCE_MEM, }, { - .start = data->iobaseemmaprp, - .end = data->iobaseemmaprp + data->iosizeemmaprp - 1, - .flags = IORESOURCE_MEM, - }, { .start = data->irqcsi, .end = data->irqcsi, .flags = IORESOURCE_IRQ, }, { + .start = data->iobaseemmaprp, + .end = data->iobaseemmaprp + data->iosizeemmaprp - 1, + .flags = IORESOURCE_MEM, + }, { .start = data->irqemmaprp, .end = data->irqemmaprp, .flags = IORESOURCE_IRQ, }, }; return imx_add_platform_device_dmamask("mx2-camera", 0, - res, ARRAY_SIZE(res), + res, data->iobaseemmaprp ? 4 : 2, pdata, sizeof(*pdata), DMA_BIT_MASK(32)); } |