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

Commit 256437ab authored by Junzhe Zou's avatar Junzhe Zou
Browse files

msm: camera: fd: move start cmd to post config



submit start register value along with others to make
sure hw start only when all the register values are
submitted by CDM.

Change-Id: I8e99b0c5ac1a7e2cdd713914f2c7dd0797e45b0d
Signed-off-by: default avatarJunzhe Zou <jnzhezou@codeaurora.org>
parent bdca4e8b
Loading
Loading
Loading
Loading
+16 −9
Original line number Diff line number Diff line
@@ -397,12 +397,22 @@ static int cam_fd_hw_util_processcmd_prestart(struct cam_hw_info *fd_hw,
	prestart_args->pre_config_buf_size =
		prestart_args->size - available_size;

	/*
	 * Currently, no post config commands, we trigger HW start directly
	 * from start(). Start trigger command can be inserted into CDM
	 * as post config commands.
	 */
	prestart_args->post_config_buf_size = 0;
	/* Insert start trigger command into CDM as post config commands. */
	num_cmds = cam_fd_cdm_write_reg_val_pair(reg_val_pair, 0,
		hw_static_info->core_regs.control, 0x2);
	size = ctx_hw_private->cdm_ops->cdm_required_size_reg_random(
		num_cmds/2);
	if ((size * 4) > available_size) {
		CAM_ERR(CAM_FD, "Insufficient size:%d , expected size:%d",
			available_size, size);
		return -ENOMEM;
	}
	ctx_hw_private->cdm_ops->cdm_write_regrandom(cmd_buf_addr, num_cmds/2,
		reg_val_pair);
	cmd_buf_addr += size;
	available_size -= (size * 4);

	prestart_args->post_config_buf_size = size * 4;

	CAM_DBG(CAM_FD, "PreConfig [%pK %d], PostConfig[%pK %d]",
		prestart_args->cmd_buf_addr, prestart_args->pre_config_buf_size,
@@ -893,9 +903,6 @@ int cam_fd_hw_start(void *hw_priv, void *hw_start_args, uint32_t arg_size)
		goto error;
	}

	cam_fd_soc_register_write(&fd_hw->soc_info, CAM_FD_REG_CORE,
		hw_static_info->core_regs.control, 0x2);

	return 0;
error:
	spin_lock(&fd_core->spin_lock);