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

Commit a9ab0dea authored by Abhishek Kondaveeti's avatar Abhishek Kondaveeti Committed by Gerrit - the friendly Code Review server
Browse files

msm: ispif: Fix device crash during open node



Enable ISPIF irqs at ispif init instead of open node

Change-Id: I92df19f2161d3015d64650e6767bec48ad9a1945
Signed-off-by: default avatarAbhishek Kondaveeti <akondave@codeaurora.org>
parent edc93d8c
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1583,6 +1583,11 @@ static int msm_ispif_init(struct ispif_device *ispif,
		return rc;
	}

	rc = msm_camera_enable_irq(ispif->irq, 1);
	if (rc < 0) {
		pr_err("%s: Error enabling IRQs\n", __func__);
		return rc;
	}
	/* can we set to zero? */
	ispif->applied_intf_cmd[VFE0].intf_cmd  = 0xFFFFFFFF;
	ispif->applied_intf_cmd[VFE0].intf_cmd1 = 0xFFFFFFFF;
@@ -1790,9 +1795,6 @@ static int ispif_open_node(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
		rc = msm_ispif_clk_ahb_enable(ispif, 1);
		if (rc)
			goto ahb_clk_enable_fail;
		rc = msm_camera_enable_irq(ispif->irq, 1);
		if (rc)
			goto irq_enable_fail;
	}
	/* mem remap is done in init when the clock is on */
	ispif->open_cnt++;
@@ -1800,8 +1802,6 @@ static int ispif_open_node(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
	return rc;
ahb_clk_enable_fail:
	msm_ispif_set_regulators(ispif->ispif_vdd, ispif->ispif_vdd_count, 0);
irq_enable_fail:
	msm_ispif_clk_ahb_enable(ispif, 0);
unlock:
	mutex_unlock(&ispif->mutex);
	return rc;