[COMMON] fimc-is2: change sub-device ch. assignment for each VC
authorJeongtae Park <jtp.park@samsung.com>
Mon, 30 Apr 2018 01:20:30 +0000 (10:20 +0900)
committerSunyoung Kang <sy0816.kang@samsung.com>
Mon, 23 Jul 2018 08:05:09 +0000 (17:05 +0900)
Change-Id: I48874561b1eff7c44d791ba0bd244142941be2ad
Signed-off-by: Jeongtae Park <jtp.park@samsung.com>
drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c

index dd11ba914d8166f2fed8c326ed7b21d81e60cd5e..c8e4c7ee01a2459d5b2f163cc638575c81e9b0b4 100644 (file)
@@ -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);