From: Jeongtae Park Date: Mon, 7 May 2018 02:11:46 +0000 (+0900) Subject: [COMMON] fimc-is2: move 'the number of sub-device channel mode' to sensor X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e6c858675a6ccd981a7272d52202f19e3558a5b5;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] fimc-is2: move 'the number of sub-device channel mode' to sensor Change-Id: I96738e3b1876642d0a12519de912e7b1bac17dcc Signed-off-by: Jeongtae Park --- diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi.h b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi.h index 672a886d95c9..824ee9e63994 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi.h +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi.h @@ -63,7 +63,6 @@ enum itf_vc_buf_data_type { struct fimc_is_device_csi { /* channel information */ u32 instance; - u32 num_of_scm; enum subdev_ch_mode scm; u32 __iomem *base_reg; u32 __iomem *vc_reg[SCM_MAX][CSI_VIRTUAL_CH_MAX]; @@ -76,7 +75,7 @@ struct fimc_is_device_csi { unsigned long vc_irq_state; /* csi common dma */ - struct fimc_is_device_csi_dma *csi_dma; + struct fimc_is_device_csi_dma *csi_dma; /* for settle time */ struct fimc_is_sensor_cfg *sensor_cfg; diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c index 9af480e88db2..7c6980a6e4fe 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c @@ -1748,9 +1748,9 @@ static int csi_s_format(struct v4l2_subdev *subdev, else csi->scm = SCM_W_PAF_HW; - if (csi->scm >= csi->num_of_scm) { + if (csi->scm >= device->num_of_ch_mode) { merr("invalid sub-device channel mode(%d/%d)", csi, - csi->scm, csi->num_of_scm); + csi->scm, device->num_of_ch_mode); return -EINVAL; } diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor.h b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor.h index 78aeb3eee637..9143e6f348ea 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor.h +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor.h @@ -420,6 +420,7 @@ struct fimc_is_device_sensor { u32 sensor_width; u32 sensor_height; + int num_of_ch_mode; bool dma_abstract; u32 use_standby; u32 sstream; diff --git a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c index c8e4c7ee01a2..efac920c002f 100644 --- a/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c +++ b/drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c @@ -1594,8 +1594,10 @@ static int __init fimc_is_sensor_probe(struct platform_device *pdev) /* DMA abstraction */ device->dma_abstract = device->pdata->dma_abstract; if (device->dma_abstract) { + device->num_of_ch_mode = device->pdata->num_of_ch_mode; + for (scm = SCM_WO_PAF_HW; - (scm < device->pdata->num_of_ch_mode) && (scm < SCM_MAX); scm++) { + (scm < device->num_of_ch_mode) && (scm < SCM_MAX); scm++) { /* DMA abstraction */ device->ssvc0.dma_ch[scm] = device->pdata->dma_ch[(scm * CSI_VIRTUAL_CH_MAX) + CSI_VIRTUAL_CH_0];