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

Commit 8272ddc1 authored by Terence Ho's avatar Terence Ho Committed by Gerrit - the friendly Code Review server
Browse files

msm: ais: fix soc resource start sequence



Fix soc resource start sequence

Change-Id: I8fa5b1aa30a9b8727216799786e608772b535273
Signed-off-by: default avatarTerence Ho <terenceh@codeaurora.org>
parent 33325985
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -126,6 +126,13 @@ int ais_ife_csid_enable_soc_resources(

	soc_private = soc_info->soc_private;

	rc = cam_soc_util_enable_platform_resource(soc_info, true,
		clk_level, true);
	if (rc) {
		CAM_ERR(CAM_ISP, "enable platform failed");
		goto end;
	}

	ahb_vote.type = CAM_VOTE_ABSOLUTE;
	ahb_vote.vote.level = CAM_SVS_VOTE;
	axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW;
@@ -139,20 +146,14 @@ int ais_ife_csid_enable_soc_resources(
	if (rc) {
		CAM_ERR(CAM_ISP, "Error CPAS start failed");
		rc = -EFAULT;
		goto end;
	}

	rc = cam_soc_util_enable_platform_resource(soc_info, true,
		clk_level, true);
	if (rc) {
		CAM_ERR(CAM_ISP, "enable platform failed");
		goto stop_cpas;
		goto disable_platform_resource;
	}
	goto end;

	return rc;
disable_platform_resource:
	if (cam_soc_util_disable_platform_resource(soc_info, true, true))
		CAM_ERR(CAM_ISP, "Disable platform resource failed");

stop_cpas:
	cam_cpas_stop(soc_private->cpas_handle);
end:
	return rc;
}
+4 −0
Original line number Diff line number Diff line
@@ -781,6 +781,8 @@ int ais_vfe_process_cmd(void *hw_priv, uint32_t cmd_type,
	core_info = (struct ais_vfe_hw_core_info *)vfe_hw->core_info;
	hw_info = core_info->vfe_hw_info;

	mutex_lock(&vfe_hw->hw_mutex);

	switch (cmd_type) {
	case AIS_VFE_CMD_ENQ_BUFFER: {
		struct ais_ife_enqueue_buffer_args *enq_buf =
@@ -797,6 +799,8 @@ int ais_vfe_process_cmd(void *hw_priv, uint32_t cmd_type,
		break;
	}

	mutex_unlock(&vfe_hw->hw_mutex);

	return rc;
}

+13 −13
Original line number Diff line number Diff line
@@ -232,6 +232,13 @@ int ais_vfe_enable_soc_resources(struct cam_hw_soc_info *soc_info)
	}
	soc_private = soc_info->soc_private;

	rc = cam_soc_util_enable_platform_resource(soc_info, true,
		CAM_TURBO_VOTE, true);
	if (rc) {
		CAM_ERR(CAM_ISP, "Error! enable platform failed rc=%d", rc);
		goto end;
	}

	ahb_vote.type       = CAM_VOTE_ABSOLUTE;
	ahb_vote.vote.level = CAM_SVS_VOTE;

@@ -243,7 +250,7 @@ int ais_vfe_enable_soc_resources(struct cam_hw_soc_info *soc_info)
	if (rc) {
		CAM_ERR(CAM_ISP, "Error! CPAS0 start failed rc=%d", rc);
		rc = -EFAULT;
		goto end;
		goto disable_platform_resource;
	}

	if (!rc && soc_private->cpas_version == CAM_CPAS_TITAN_175_V120)
@@ -252,22 +259,15 @@ int ais_vfe_enable_soc_resources(struct cam_hw_soc_info *soc_info)
		if (rc) {
			CAM_ERR(CAM_ISP, "Error! CPAS1 start failed rc=%d", rc);
			rc = -EFAULT;
			goto end;
			goto disable_platform_resource;
		}

	rc = cam_soc_util_enable_platform_resource(soc_info, true,
		CAM_TURBO_VOTE, true);
	if (rc) {
		CAM_ERR(CAM_ISP, "Error! enable platform failed rc=%d", rc);
		goto stop_cpas;
	}
	goto end;

	return rc;
disable_platform_resource:
	if (cam_soc_util_disable_platform_resource(soc_info, true, true))
		CAM_ERR(CAM_ISP, "Disable platform resource failed");

stop_cpas:
	cam_cpas_stop(soc_private->cpas_handle[0]);
	if (soc_private->cpas_version == CAM_CPAS_TITAN_175_V120)
		cam_cpas_stop(soc_private->cpas_handle[1]);
end:
	return rc;
}