Linux 5.7.7
[linux/fpc-iii.git] / arch / arm / mach-imx / devices / platform-mx2-camera.c
blob5375f8b3d07983a017aadd558393731c49aa03e4
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Copyright (C) 2010 Pengutronix
4 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
5 */
6 #include "../hardware.h"
7 #include "devices-common.h"
9 #define imx_mx2_camera_data_entry_single(soc, _devid) \
10 { \
11 .devid = _devid, \
12 .iobasecsi = soc ## _CSI_BASE_ADDR, \
13 .iosizecsi = SZ_4K, \
14 .irqcsi = soc ## _INT_CSI, \
16 #define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
17 { \
18 .devid = _devid, \
19 .iobasecsi = soc ## _CSI_BASE_ADDR, \
20 .iosizecsi = SZ_32, \
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,
41 }, {
42 .start = data->irqcsi,
43 .end = data->irqcsi,
44 .flags = IORESOURCE_IRQ,
45 }, {
46 .start = data->iobaseemmaprp,
47 .end = data->iobaseemmaprp + data->iosizeemmaprp - 1,
48 .flags = IORESOURCE_MEM,
49 }, {
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));