[COMMON] fimc-is2: fix wrong setting for pre_flash fire work
authorWooyeon Kim <wooy88.kim@samsung.com>
Mon, 18 Feb 2019 10:23:37 +0000 (19:23 +0900)
committerlingsen1 <lingsen1@lenovo.com>
Mon, 10 Jun 2019 03:21:09 +0000 (11:21 +0800)
 - wrong setting timing is fixed

 PR JIRA ID: CPR-709

Change-Id: I40bd6b0fe345a1dbefc24f29fcd93e2769ec3286
Signed-off-by: Wooyeon Kim <wooy88.kim@samsung.com>
drivers/media/platform/exynos/fimc-is2/sensor/module_framework/fimc-is-control-sensor.c
drivers/media/platform/exynos/fimc-is2/sensor/module_framework/fimc-is-device-sensor-peri.c

index 0932b958640df3ebd8ca639374c1988de2f9272a..9b4882cb2d12f718329d0f913230f9a7e81e5fd1 100644 (file)
@@ -769,11 +769,7 @@ void fimc_is_sensor_ctl_frame_evt(struct fimc_is_device_sensor *device)
 
        if (sensor_peri->subdev_flash != NULL && module_ctl->valid_flash_udctrl) {
                /* Pre-Flash on, Torch on/off */
-#if defined(USE_PRE_FLASH_FIRE_WORK)
-               schedule_work(&sensor_peri->flash->flash_data.pre_flash_work);
-#else
-               ret = fimc_is_sensor_peri_pre_flash_fire(device->subdev_module, &vsync_count);
-#endif
+               ret = fimc_is_sensor_peri_pre_flash_fire(device->subdev_module, &applied_frame_number);
        }
 
        if (sensor_peri->ois) {
index ce172c5f33a3ab61665861c52c4a144bec0bed9a..9c587eed48c0a31779b8ed4992c52e5f8d4b46b9 100755 (executable)
@@ -627,11 +627,7 @@ void fimc_is_sensor_pre_flash_fire_work(struct work_struct *data)
        int ret = 0;
        struct fimc_is_flash *flash = NULL;
        struct fimc_is_flash_data *flash_data;
-       struct fimc_is_device_sensor *device;
-       struct fimc_is_sensor_ctl *sensor_ctl = NULL;
        struct fimc_is_device_sensor_peri *sensor_peri = NULL;
-       struct v4l2_subdev *subdev_flash;
-       camera2_flash_uctl_t *flash_uctl = NULL;
 
        FIMC_BUG_VOID(!data);
 
@@ -644,35 +640,7 @@ void fimc_is_sensor_pre_flash_fire_work(struct work_struct *data)
        sensor_peri = flash->sensor_peri;
        FIMC_BUG_VOID(!sensor_peri);
 
-       subdev_flash = sensor_peri->subdev_flash;
-       device = v4l2_get_subdev_hostdata(subdev_flash);
-       FIMC_BUG_VOID(!device);
-
-       flash = sensor_peri->flash;
-       FIMC_BUG_VOID(!flash);
-
-       sensor_ctl = &sensor_peri->cis.sensor_ctls[device->fcount % CAM2P0_UCTL_LIST_SIZE];
-
-       flash_uctl = &sensor_ctl->cur_cam20_flash_udctrl;
-
-       if ((flash_uctl->flashMode != flash->flash_data.mode) ||
-               (flash_uctl->flashMode != CAM2_FLASH_MODE_OFF && flash_uctl->firingPower == 0)) {
-               flash->flash_data.mode = flash_uctl->flashMode;
-               flash->flash_data.intensity = flash_uctl->firingPower;
-               flash->flash_data.firing_time_us = flash_uctl->firingTime;
-
-               info("[%s](%d) pre-flash mode(%d), pow(%d), time(%d)\n", __func__,
-                       device->fcount, flash->flash_data.mode,
-                       flash->flash_data.intensity, flash->flash_data.firing_time_us);
-               ret = fimc_is_sensor_flash_fire(sensor_peri, flash->flash_data.intensity);
-       }
-
-       /* HACK: reset uctl */
-       flash_uctl->flashMode = 0;
-       flash_uctl->firingPower = 0;
-       flash_uctl->firingTime = 0;
-       sensor_ctl->flash_frame_number = 0;
-       sensor_ctl->valid_flash_udctrl = false;
+       ret = fimc_is_sensor_flash_fire(sensor_peri, flash->flash_data.intensity);
 }
 
 void fimc_is_sensor_flash_fire_work(struct work_struct *data)
@@ -1498,7 +1466,11 @@ int fimc_is_sensor_peri_pre_flash_fire(struct v4l2_subdev *subdev, void *arg)
                info("[%s](%d) pre-flash mode(%d), pow(%d), time(%d)\n", __func__,
                        vsync_count, flash->flash_data.mode,
                        flash->flash_data.intensity, flash->flash_data.firing_time_us);
+#if defined(USE_PRE_FLASH_FIRE_WORK)
+               schedule_work(&sensor_peri->flash->flash_data.pre_flash_work);
+#else
                ret = fimc_is_sensor_flash_fire(sensor_peri, flash->flash_data.intensity);
+#endif
        }
 
        /* HACK: reset uctl */