From 793c519d385606ff6a1ffc0d26ca2242d8a434a7 Mon Sep 17 00:00:00 2001 From: Jeongtae Park Date: Mon, 30 Apr 2018 10:20:30 +0900 Subject: [PATCH] [COMMON] fimc-is2: change sub-device ch. assignment for each VC Change-Id: I48874561b1eff7c44d791ba0bd244142941be2ad Signed-off-by: Jeongtae Park --- .../fimc-is2/fimc-is-device-sensor_v2.c | 45 ++++++++++--------- 1 file changed, 25 insertions(+), 20 deletions(-) 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 dd11ba914d81..c8e4c7ee01a2 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 @@ -1416,6 +1416,7 @@ static int __init fimc_is_sensor_probe(struct platform_device *pdev) struct fimc_is_core *core; struct fimc_is_device_sensor *device; void *pdata; + enum subdev_ch_mode scm; FIMC_BUG(!pdev); @@ -1592,26 +1593,30 @@ static int __init fimc_is_sensor_probe(struct platform_device *pdev) /* DMA abstraction */ device->dma_abstract = device->pdata->dma_abstract; - device->ssvc0.dma_ch[SCM_WO_PAF_HW] = device->pdata->dma_ch[0]; - device->ssvc1.dma_ch[SCM_WO_PAF_HW] = device->pdata->dma_ch[1]; - device->ssvc2.dma_ch[SCM_WO_PAF_HW] = device->pdata->dma_ch[2]; - device->ssvc3.dma_ch[SCM_WO_PAF_HW] = device->pdata->dma_ch[3]; - - device->ssvc0.dma_ch[SCM_W_PAF_HW] = device->pdata->dma_ch[4]; - device->ssvc1.dma_ch[SCM_W_PAF_HW] = device->pdata->dma_ch[5]; - device->ssvc2.dma_ch[SCM_W_PAF_HW] = device->pdata->dma_ch[6]; - device->ssvc3.dma_ch[SCM_W_PAF_HW] = device->pdata->dma_ch[7]; - - /* VC abstraction */ - device->ssvc0.vc_ch[SCM_WO_PAF_HW] = device->pdata->vc_ch[0]; - device->ssvc1.vc_ch[SCM_WO_PAF_HW] = device->pdata->vc_ch[1]; - device->ssvc2.vc_ch[SCM_WO_PAF_HW] = device->pdata->vc_ch[2]; - device->ssvc3.vc_ch[SCM_WO_PAF_HW] = device->pdata->vc_ch[3]; - - device->ssvc0.vc_ch[SCM_W_PAF_HW] = device->pdata->vc_ch[4]; - device->ssvc1.vc_ch[SCM_W_PAF_HW] = device->pdata->vc_ch[5]; - device->ssvc2.vc_ch[SCM_W_PAF_HW] = device->pdata->vc_ch[6]; - device->ssvc3.vc_ch[SCM_W_PAF_HW] = device->pdata->vc_ch[7]; + if (device->dma_abstract) { + for (scm = SCM_WO_PAF_HW; + (scm < device->pdata->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]; + device->ssvc1.dma_ch[scm] + = device->pdata->dma_ch[(scm * CSI_VIRTUAL_CH_MAX) + CSI_VIRTUAL_CH_1]; + device->ssvc2.dma_ch[scm] + = device->pdata->dma_ch[(scm * CSI_VIRTUAL_CH_MAX) + CSI_VIRTUAL_CH_2]; + device->ssvc3.dma_ch[scm] + = device->pdata->dma_ch[(scm * CSI_VIRTUAL_CH_MAX) + CSI_VIRTUAL_CH_3]; + + /* VC abstraction */ + device->ssvc0.vc_ch[scm] + = device->pdata->vc_ch[(scm * CSI_VIRTUAL_CH_MAX) + CSI_VIRTUAL_CH_0]; + device->ssvc1.vc_ch[scm] + = device->pdata->vc_ch[(scm * CSI_VIRTUAL_CH_MAX) + CSI_VIRTUAL_CH_1]; + device->ssvc2.vc_ch[scm] + = device->pdata->vc_ch[(scm * CSI_VIRTUAL_CH_MAX) + CSI_VIRTUAL_CH_2]; + device->ssvc3.vc_ch[scm] + = device->pdata->vc_ch[(scm * CSI_VIRTUAL_CH_MAX) + CSI_VIRTUAL_CH_3]; + } + } set_bit(FIMC_IS_SENSOR_PROBE, &device->state); -- 2.20.1