[COMMON] fimc-is2: move 'the number of sub-device channel mode' to sensor
authorJeongtae Park <jtp.park@samsung.com>
Mon, 7 May 2018 02:11:46 +0000 (11:11 +0900)
committerSunyoung Kang <sy0816.kang@samsung.com>
Mon, 23 Jul 2018 08:05:09 +0000 (17:05 +0900)
Change-Id: I96738e3b1876642d0a12519de912e7b1bac17dcc
Signed-off-by: Jeongtae Park <jtp.park@samsung.com>
drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi.h
drivers/media/platform/exynos/fimc-is2/fimc-is-device-csi_v4.c
drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor.h
drivers/media/platform/exynos/fimc-is2/fimc-is-device-sensor_v2.c

index 672a886d95c9a174d8b0da688f16b357656b279d..824ee9e639944cdbb1379ace5561069e110b2055 100644 (file)
@@ -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;
index 9af480e88db2781c9cae5ddc557d9b9c28bf28db..7c6980a6e4fee11f05584aa72b163721ecb34078 100644 (file)
@@ -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;
        }
 
index 78aeb3eee637240a21f348cfd7125c842aa1a2c5..9143e6f348ea96bb79359bc175dd9bf0daa16d52 100644 (file)
@@ -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;
index c8e4c7ee01a2459d5b2f163cc638575c81e9b0b4..efac920c002f6e6e963975ee144125c7ab61994f 100644 (file)
@@ -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];