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

Commit 2d96c5e6 authored by Harsh Shah's avatar Harsh Shah
Browse files

msm: camera: isp: Reuse existing release function



When calling release in activated state, we need to do 2 steps,
stop the devices and then release. There are existing APIs for
both, so reuse them to avoid missing any fixes made in one and
accidentally skipped in other causing bugs.

Change-Id: I258b881ed358456e5c8e35968fe9970dbc4ea940
Signed-off-by: default avatarHarsh Shah <harshs@codeaurora.org>
parent 65ad3cde
Loading
Loading
Loading
Loading
+6 −19
Original line number Diff line number Diff line
@@ -1949,27 +1949,14 @@ static int __cam_isp_ctx_release_dev_in_activated(struct cam_context *ctx,
	struct cam_release_dev_cmd *cmd)
{
	int rc = 0;
	struct cam_isp_context *ctx_isp =
		(struct cam_isp_context *) ctx->ctx_priv;

	__cam_isp_ctx_stop_dev_in_activated_unlock(ctx);

	if (ctx_isp->hw_ctx) {
		struct cam_hw_release_args   arg;

		arg.ctxt_to_hw_map = ctx_isp->hw_ctx;
		ctx->hw_mgr_intf->hw_release(ctx->hw_mgr_intf->hw_mgr_priv,
			&arg);
		ctx_isp->hw_ctx = NULL;
	}

	ctx->session_hdl = 0;
	ctx->dev_hdl = 0;
	ctx->link_hdl = 0;
	ctx->ctx_crm_intf = NULL;
	rc = __cam_isp_ctx_stop_dev_in_activated_unlock(ctx);
	if (rc)
		CAM_ERR(CAM_ISP, "Stop device failed rc=%d", rc);

	ctx->state =  CAM_CTX_AVAILABLE;
	trace_cam_context_state("ISP", ctx);
	rc = __cam_isp_ctx_release_dev_in_top_state(ctx, cmd);
	if (rc)
		CAM_ERR(CAM_ISP, "Release device failed rc=%d", rc);

	return rc;
}
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ static int cam_vfe_rdi_get_reg_update(
	rsrc_data = rdi_res->res_priv;
	reg_val_pair[0] = rsrc_data->rdi_reg->reg_update_cmd;
	reg_val_pair[1] = rsrc_data->reg_data->reg_update_cmd_data;
	CAM_DBG(CAM_ISP, "Error - RDI%d reg_update_cmd %x",
	CAM_DBG(CAM_ISP, "RDI%d reg_update_cmd %x",
		rdi_res->res_id - CAM_ISP_HW_VFE_IN_RDI0, reg_val_pair[1]);

	cdm_util_ops->cdm_write_regrandom(cdm_args->cmd_buf_addr,