Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f798d4e authored by Peter Liu's avatar Peter Liu
Browse files

msm: camera: isp: enforce halt and stop camera when close



During close node, ISP need to be stopped.
Enforce VBIF clock to make sure halt can go through.
Even halt is already issued, it will be safer
if we further issue stop camif to cover any case
halt failed.

Change-Id: I33efbb3e121ef1653dbb80402bb399a0323b6f61
Signed-off-by: default avatarPeter Liu <pingchie@codeaurora.org>
parent 861a4ae9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@
#define STATS_COMP_IDX_IHIST     6
#define STATS_COMP_IDX_BHIST     7
#define STATS_COMP_IDX_AEC_BG    8
#define VFE47_VBIF_CLK_OFFSET    0x4

static uint32_t stats_base_addr[] = {
	0x1D4, /* HDR_BE */
@@ -395,10 +396,16 @@ static void msm_vfe47_process_reset_irq(struct vfe_device *vfe_dev,
static void msm_vfe47_process_halt_irq(struct vfe_device *vfe_dev,
	uint32_t irq_status0, uint32_t irq_status1)
{
	uint32_t val = 0;

	if (irq_status1 & (1 << 8)) {
		complete(&vfe_dev->halt_complete);
		msm_camera_io_w(0x0, vfe_dev->vfe_base + 0x400);
	}

	val = msm_camera_io_r(vfe_dev->vfe_vbif_base + VFE47_VBIF_CLK_OFFSET);
	val &= ~(0x1);
	msm_camera_io_w(val, vfe_dev->vfe_vbif_base + VFE47_VBIF_CLK_OFFSET);
}

static void msm_vfe47_process_input_irq(struct vfe_device *vfe_dev,
@@ -1554,6 +1561,11 @@ static int msm_vfe47_axi_halt(struct vfe_device *vfe_dev,
{
	int rc = 0;
	enum msm_vfe_input_src i;
	uint32_t val = 0;

	val = msm_camera_io_r(vfe_dev->vfe_vbif_base + VFE47_VBIF_CLK_OFFSET);
	val |= 0x1;
	msm_camera_io_w(val, vfe_dev->vfe_vbif_base + VFE47_VBIF_CLK_OFFSET);

	/* Keep only halt and reset mask */
	msm_camera_io_w(BIT(31), vfe_dev->vfe_base + 0x5C);
+4 −0
Original line number Diff line number Diff line
@@ -2007,6 +2007,10 @@ int msm_isp_close_node(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
	if (rc <= 0)
		pr_err("%s: halt timeout rc=%ld\n", __func__, rc);

	vfe_dev->hw_info->vfe_ops.core_ops.
		update_camif_state(vfe_dev, DISABLE_CAMIF_IMMEDIATELY);
	vfe_dev->hw_info->vfe_ops.core_ops.reset_hw(vfe_dev, 0, 0);

	vfe_dev->buf_mgr->ops->buf_mgr_deinit(vfe_dev->buf_mgr);
	vfe_dev->hw_info->vfe_ops.core_ops.release_hw(vfe_dev);
	if (vfe_dev->vt_enable) {