1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2010 Pengutronix
4 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
6 #include "../hardware.h"
7 #include "devices-common.h"
9 #define imx_mx2_camera_data_entry_single(soc, _devid) \
12 .iobasecsi = soc ## _CSI_BASE_ADDR, \
14 .irqcsi = soc ## _INT_CSI, \
16 #define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
19 .iobasecsi = soc ## _CSI_BASE_ADDR, \
21 .irqcsi = soc ## _INT_CSI, \
22 .iobaseemmaprp = soc ## _EMMAPRP_BASE_ADDR, \
23 .iosizeemmaprp = SZ_32, \
24 .irqemmaprp = soc ## _INT_EMMAPRP, \
27 #ifdef CONFIG_SOC_IMX27
28 const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst
=
29 imx_mx2_camera_data_entry_single_emma(MX27
, "imx27-camera");
30 #endif /* ifdef CONFIG_SOC_IMX27 */
32 struct platform_device
*__init
imx_add_mx2_camera(
33 const struct imx_mx2_camera_data
*data
,
34 const struct mx2_camera_platform_data
*pdata
)
36 struct resource res
[] = {
38 .start
= data
->iobasecsi
,
39 .end
= data
->iobasecsi
+ data
->iosizecsi
- 1,
40 .flags
= IORESOURCE_MEM
,
42 .start
= data
->irqcsi
,
44 .flags
= IORESOURCE_IRQ
,
46 .start
= data
->iobaseemmaprp
,
47 .end
= data
->iobaseemmaprp
+ data
->iosizeemmaprp
- 1,
48 .flags
= IORESOURCE_MEM
,
50 .start
= data
->irqemmaprp
,
51 .end
= data
->irqemmaprp
,
52 .flags
= IORESOURCE_IRQ
,
55 return imx_add_platform_device_dmamask(data
->devid
, 0,
56 res
, data
->iobaseemmaprp
? 4 : 2,
57 pdata
, sizeof(*pdata
), DMA_BIT_MASK(32));