diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-11 11:11:34 -0500 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-19 15:53:48 -0500 |
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 a18c80355de0..b3f4828dc447 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 @@ | |||
12 | #define imx_mx2_camera_data_entry_single(soc) \ | 12 | #define imx_mx2_camera_data_entry_single(soc) \ |
13 | { \ | 13 | { \ |
14 | .iobasecsi = soc ## _CSI_BASE_ADDR, \ | 14 | .iobasecsi = soc ## _CSI_BASE_ADDR, \ |
15 | .iosizecsi = SZ_4K, \ | ||
16 | .irqcsi = soc ## _INT_CSI, \ | ||
17 | } | ||
18 | #define imx_mx2_camera_data_entry_single_emma(soc) \ | ||
19 | { \ | ||
20 | .iobasecsi = soc ## _CSI_BASE_ADDR, \ | ||
15 | .iosizecsi = SZ_32, \ | 21 | .iosizecsi = SZ_32, \ |
16 | .irqcsi = soc ## _INT_CSI, \ | 22 | .irqcsi = soc ## _INT_CSI, \ |
17 | .iobaseemmaprp = soc ## _EMMAPRP_BASE_ADDR, \ | 23 | .iobaseemmaprp = soc ## _EMMAPRP_BASE_ADDR, \ |
@@ -19,9 +25,14 @@ | |||
19 | .irqemmaprp = soc ## _INT_EMMAPRP, \ | 25 | .irqemmaprp = soc ## _INT_EMMAPRP, \ |
20 | } | 26 | } |
21 | 27 | ||
28 | #ifdef CONFIG_SOC_IMX25 | ||
29 | const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst = | ||
30 | imx_mx2_camera_data_entry_single(MX25); | ||
31 | #endif /* ifdef CONFIG_SOC_IMX25 */ | ||
32 | |||
22 | #ifdef CONFIG_SOC_IMX27 | 33 | #ifdef CONFIG_SOC_IMX27 |
23 | const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst = | 34 | const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst = |
24 | imx_mx2_camera_data_entry_single(MX27); | 35 | imx_mx2_camera_data_entry_single_emma(MX27); |
25 | #endif /* ifdef CONFIG_SOC_IMX27 */ | 36 | #endif /* ifdef CONFIG_SOC_IMX27 */ |
26 | 37 | ||
27 | struct platform_device *__init imx_add_mx2_camera( | 38 | struct platform_device *__init imx_add_mx2_camera( |
@@ -34,20 +45,20 @@ struct platform_device *__init imx_add_mx2_camera( | |||
34 | .end = data->iobasecsi + data->iosizecsi - 1, | 45 | .end = data->iobasecsi + data->iosizecsi - 1, |
35 | .flags = IORESOURCE_MEM, | 46 | .flags = IORESOURCE_MEM, |
36 | }, { | 47 | }, { |
37 | .start = data->iobaseemmaprp, | ||
38 | .end = data->iobaseemmaprp + data->iosizeemmaprp - 1, | ||
39 | .flags = IORESOURCE_MEM, | ||
40 | }, { | ||
41 | .start = data->irqcsi, | 48 | .start = data->irqcsi, |
42 | .end = data->irqcsi, | 49 | .end = data->irqcsi, |
43 | .flags = IORESOURCE_IRQ, | 50 | .flags = IORESOURCE_IRQ, |
44 | }, { | 51 | }, { |
52 | .start = data->iobaseemmaprp, | ||
53 | .end = data->iobaseemmaprp + data->iosizeemmaprp - 1, | ||
54 | .flags = IORESOURCE_MEM, | ||
55 | }, { | ||
45 | .start = data->irqemmaprp, | 56 | .start = data->irqemmaprp, |
46 | .end = data->irqemmaprp, | 57 | .end = data->irqemmaprp, |
47 | .flags = IORESOURCE_IRQ, | 58 | .flags = IORESOURCE_IRQ, |
48 | }, | 59 | }, |
49 | }; | 60 | }; |
50 | return imx_add_platform_device_dmamask("mx2-camera", 0, | 61 | return imx_add_platform_device_dmamask("mx2-camera", 0, |
51 | res, ARRAY_SIZE(res), | 62 | res, data->iobaseemmaprp ? 4 : 2, |
52 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); | 63 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); |
53 | } | 64 | } |