From 096e91dd010f97c902c5bc17d6f204e2ec736493 Mon Sep 17 00:00:00 2001 From: Wooki Min Date: Thu, 31 May 2018 18:58:14 +0900 Subject: [PATCH] [COMMON] fimc-is2: force vsync generation Change-Id: I4f62b3bda66320276e38db614790704e106fb1fa Signed-off-by: Wooki Min --- .../exynos/fimc-is2/fimc-is-device-csi.h | 1 + .../exynos/fimc-is2/fimc-is-device-csi_v4.c | 2 +- .../interface/fimc-is-interface-ddk.c | 36 +++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) 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 d0d385e39ea9..ff8ef287ef06 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 @@ -130,6 +130,7 @@ struct fimc_is_device_csi_dma { spinlock_t barrier; }; +void csi_frame_start_inline(struct fimc_is_device_csi *csi); int __must_check fimc_is_csi_dma_probe(struct fimc_is_device_csi_dma *csi_dma, struct platform_device *pdev); int __must_check fimc_is_csi_probe(void *parent, u32 instance); 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 594fb0dad7c7..2375633106e3 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 @@ -48,7 +48,7 @@ static enum hrtimer_restart csis_early_buf_done(struct hrtimer *timer) } #endif -static inline void csi_frame_start_inline(struct fimc_is_device_csi *csi) +inline void csi_frame_start_inline(struct fimc_is_device_csi *csi) { /* frame start interrupt */ csi->sw_checker = EXPECT_FRAME_END; diff --git a/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-ddk.c b/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-ddk.c index 2a92e8a988f4..90dabd1db57b 100644 --- a/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-ddk.c +++ b/drivers/media/platform/exynos/fimc-is2/interface/fimc-is-interface-ddk.c @@ -400,6 +400,42 @@ static void fimc_is_lib_camera_callback(void *this, enum lib_cb_event_type event fimc_is_hardware_config_lock(hw_ip, instance_id, (u32)fcount); break; case LIB_EVENT_FRAME_START_ISR: + if (sysfs_debug.pattern_en && (hw_ip->id == DEV_HW_3AA0 || hw_ip->id == DEV_HW_3AA1)) { + struct fimc_is_group *group; + struct v4l2_subdev *subdev; + struct fimc_is_device_csi *csi; + + group = hw_ip->group[instance_id]; + if (IS_ERR_OR_NULL(group)) { + mserr_hw("group is NULL", instance_id, hw_ip); + return; + } + + if (IS_ERR_OR_NULL(group->device)) { + mserr_hw("device is NULL", instance_id, hw_ip); + return; + } + + if (IS_ERR_OR_NULL(group->device->sensor)) { + mserr_hw("sensor is NULL", instance_id, hw_ip); + return; + } + + if (IS_ERR_OR_NULL(group->device->sensor->subdev_csi)) { + mserr_hw("subdev_csi is NULL", instance_id, hw_ip); + return; + } + + subdev = group->device->sensor->subdev_csi; + csi = v4l2_get_subdevdata(subdev); + if (IS_ERR_OR_NULL(csi)) { + mserr_hw("csi is NULL", instance_id, hw_ip); + return; + } + + csi_frame_start_inline(csi); + } + hw_ip->debug_index[1] = hw_ip->debug_index[0] % DEBUG_FRAME_COUNT; index = hw_ip->debug_index[1]; hw_ip->debug_info[index].fcount = hw_ip->debug_index[0]; -- 2.20.1