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

Commit e9e13063 authored by Alok Pandey's avatar Alok Pandey
Browse files

msm: camera: isp: Change voting logic to support new ports in sdmmagpie



It adds logic to support voting for RDI and NRDI traffic on CAMNOC/MNOC
ports separately. This change is required in sdmmagpie.

Change-Id: Ie4408bf65d7dc006278fdf0775d52cc1d0ddec6d
Signed-off-by: default avatarAlok Pandey <akumarpa@codeaurora.org>
Signed-off-by: default avatarTrishansh Bhardwaj <tbhardwa@codeaurora.org>
parent cc2aae71
Loading
Loading
Loading
Loading
+24 −18
Original line number Diff line number Diff line
@@ -1101,25 +1101,30 @@
		client-names =
			"csiphy0", "csiphy1", "csiphy2", "csiphy3",
			"cci0", "cci1",
			"csid0", "csid1", "csid2", "csid3",
			"ife0", "ife1", "ife2", "ife3",
			"csid0", "csid1", "csid2",
			"iferdi0", "ifenrdi0", "iferdi1", "ifenrdi1",
			"iferdi2", "ifenrdi2",
			"ipe0", "ipe1", "cam-cdm-intf0", "cpas-cdm0",
			"bps0", "icp0", "jpeg-dma0", "jpeg-enc0",
			"fd0", "lrmecpas0";
		client-axi-port-names =
			"cam_hf_1", "cam_hf_2", "cam_hf_1", "cam_hf_2",
			"cam_sf_1", "cam_sf_1",
			"cam_hf_1", "cam_hf_2", "cam_hf_1", "cam_hf_2",
			"cam_hf_1", "cam_hf_2", "cam_hf_1", "cam_hf_2",
			"cam_sf_1", "cam_sf_1", "cam_sf_1", "cam_sf_1",
			"cam_sf_1", "cam_sf_1", "cam_sf_1", "cam_sf_1",
			"cam_sf_1", "cam_sf_1";
			"cam_hf_0", "cam_hf_0", "cam_hf_0", "cam_hf_0",
			"cam_sf_0", "cam_sf_0",
			"cam_hf_0", "cam_hf_0", "cam_hf_0",
			"cam_hf_1", "cam_hf_0", "cam_hf_1", "cam_hf_0",
			"cam_hf_1", "cam_hf_0",
			"cam_sf_0", "cam_sf_0", "cam_sf_0", "cam_sf_0",
			"cam_sf_0", "cam_sf_1", "cam_sf_0", "cam_sf_0",
			"cam_sf_0", "cam_sf_0";
		client-bus-camnoc-based;
		qcom,axi-port-list {
			qcom,axi-port1 {
				qcom,axi-port-name = "cam_hf_1";
				/* this port is clubbed port of two ports
				 * (READ and PIX ports)
				 */
				qcom,axi-port-name = "cam_hf_0";
				qcom,axi-port-mnoc {
					qcom,msm-bus,name = "cam_hf_1_mnoc";
					qcom,msm-bus,name = "cam_hf_0_mnoc";
					qcom,msm-bus-vector-dyn-vote;
					qcom,msm-bus,num-cases = <2>;
					qcom,msm-bus,num-paths = <1>;
@@ -1130,7 +1135,7 @@
					MSM_BUS_SLAVE_EBI_CH0 0 0>;
				};
				qcom,axi-port-camnoc {
					qcom,msm-bus,name = "cam_hf_1_camnoc";
					qcom,msm-bus,name = "cam_hf_0_camnoc";
					qcom,msm-bus-vector-dyn-vote;
					qcom,msm-bus,num-cases = <2>;
					qcom,msm-bus,num-paths = <1>;
@@ -1142,9 +1147,10 @@
				};
			};
			qcom,axi-port2 {
				qcom,axi-port-name = "cam_hf_2";
				/* this port is for rdi only WR*/
				qcom,axi-port-name = "cam_hf_1";
				qcom,axi-port-mnoc {
					qcom,msm-bus,name = "cam_hf_2_mnoc";
					qcom,msm-bus,name = "cam_hf_1_mnoc";
					qcom,msm-bus-vector-dyn-vote;
					qcom,msm-bus,num-cases = <2>;
					qcom,msm-bus,num-paths = <1>;
@@ -1155,7 +1161,7 @@
					MSM_BUS_SLAVE_EBI_CH0 0 0>;
				};
				qcom,axi-port-camnoc {
					qcom,msm-bus,name = "cam_hf_2_camnoc";
					qcom,msm-bus,name = "cam_hf_1_camnoc";
					qcom,msm-bus-vector-dyn-vote;
					qcom,msm-bus,num-cases = <2>;
					qcom,msm-bus,num-paths = <1>;
@@ -1167,9 +1173,9 @@
				};
			};
			qcom,axi-port3 {
				qcom,axi-port-name = "cam_sf_1";
				qcom,axi-port-name = "cam_sf_0";
				qcom,axi-port-mnoc {
					qcom,msm-bus,name = "cam_sf_1_mnoc";
					qcom,msm-bus,name = "cam_sf_0_mnoc";
					qcom,msm-bus-vector-dyn-vote;
					qcom,msm-bus,num-cases = <2>;
					qcom,msm-bus,num-paths = <1>;
@@ -1180,7 +1186,7 @@
					MSM_BUS_SLAVE_EBI_CH0 0 0>;
				};
				qcom,axi-port-camnoc {
					qcom,msm-bus,name = "cam_sf_1_camnoc";
					qcom,msm-bus,name = "cam_sf_0_camnoc";
					qcom,msm-bus-vector-dyn-vote;
					qcom,msm-bus,num-cases = <2>;
					qcom,msm-bus,num-paths = <1>;
+73 −14
Original line number Diff line number Diff line
@@ -117,20 +117,56 @@ int cam_vfe_init_soc_resources(struct cam_hw_soc_info *soc_info,
	}

	memset(&cpas_register_param, 0, sizeof(cpas_register_param));
	strlcpy(cpas_register_param.identifier, "ife",
		CAM_HW_IDENTIFIER_LENGTH);

	cpas_register_param.cell_index = soc_info->index;
	cpas_register_param.dev = soc_info->dev;
	cpas_register_param.cam_cpas_client_cb = cam_vfe_cpas_cb;
	cpas_register_param.userdata = soc_info;

	rc = cam_cpas_get_cpas_hw_version(&soc_private->cpas_version);
	if (rc) {
		CAM_ERR(CAM_ISP, "Error! Invalid cpas version rc=%d", rc);
		goto free_soc_private;
	}

	switch (soc_private->cpas_version) {
	case CAM_CPAS_TITAN_175_V120:
		strlcpy(cpas_register_param.identifier, "iferdi",
			CAM_HW_IDENTIFIER_LENGTH);
		rc = cam_cpas_register_client(&cpas_register_param);
		if (rc) {
		CAM_ERR(CAM_ISP, "CPAS registration failed rc=%d", rc);
			CAM_ERR(CAM_ISP, "rdi CPAS registration failed rc=%d",
				rc);
			goto release_soc;
		} else {
		soc_private->cpas_handle = cpas_register_param.client_handle;
			soc_private->cpas_handle[0] =
				cpas_register_param.client_handle;
		}

		strlcpy(cpas_register_param.identifier, "ifenrdi",
			CAM_HW_IDENTIFIER_LENGTH);
		rc = cam_cpas_register_client(&cpas_register_param);
		if (rc) {
			CAM_ERR(CAM_ISP, "nrdi CPAS registration failed rc=%d",
				rc);
			goto release_soc;
		} else {
			soc_private->cpas_handle[1] =
				cpas_register_param.client_handle;
		}
		break;
	default:
		strlcpy(cpas_register_param.identifier, "ife",
			CAM_HW_IDENTIFIER_LENGTH);
		rc = cam_cpas_register_client(&cpas_register_param);
		if (rc) {
			CAM_ERR(CAM_ISP, "CPAS registration failed rc=%d", rc);
			goto release_soc;
		} else {
			soc_private->cpas_handle[0] =
				cpas_register_param.client_handle;
		}
	}
	return rc;

release_soc:
@@ -156,10 +192,15 @@ int cam_vfe_deinit_soc_resources(struct cam_hw_soc_info *soc_info)
		CAM_ERR(CAM_ISP, "Error! soc_private NULL");
		return -ENODEV;
	}
	rc = cam_cpas_unregister_client(soc_private->cpas_handle[0]);
	if (rc)
		CAM_ERR(CAM_ISP, "CPAS0 unregistration failed rc=%d", rc);

	rc = cam_cpas_unregister_client(soc_private->cpas_handle);
	if (!rc && soc_private->cpas_version == CAM_CPAS_TITAN_175_V120)
		rc = cam_cpas_unregister_client(soc_private->cpas_handle[1]);
		if (rc)
		CAM_ERR(CAM_ISP, "CPAS unregistration failed rc=%d", rc);
			CAM_ERR(CAM_ISP, "CPAS1 unregistration failed rc=%d",
				rc);

	rc = cam_vfe_release_platform_resource(soc_info);
	if (rc < 0)
@@ -196,9 +237,18 @@ int cam_vfe_enable_soc_resources(struct cam_hw_soc_info *soc_info)
	axi_vote.compressed_bw   = 10640000000L;
	axi_vote.uncompressed_bw = 10640000000L;

	rc = cam_cpas_start(soc_private->cpas_handle, &ahb_vote, &axi_vote);
	rc = cam_cpas_start(soc_private->cpas_handle[0], &ahb_vote, &axi_vote);
	if (rc) {
		CAM_ERR(CAM_ISP, "Error! CPAS start failed rc=%d", rc);
		CAM_ERR(CAM_ISP, "Error! CPAS0 start failed rc=%d", rc);
		rc = -EFAULT;
		goto end;
	}

	if (!rc && soc_private->cpas_version == CAM_CPAS_TITAN_175_V120)
		rc = cam_cpas_start(soc_private->cpas_handle[1], &ahb_vote,
			&axi_vote);
		if (rc) {
			CAM_ERR(CAM_ISP, "Error! CPAS1 start failed rc=%d", rc);
			rc = -EFAULT;
			goto end;
		}
@@ -213,7 +263,9 @@ int cam_vfe_enable_soc_resources(struct cam_hw_soc_info *soc_info)
	return rc;

stop_cpas:
	cam_cpas_stop(soc_private->cpas_handle);
	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;
}
@@ -285,7 +337,14 @@ int cam_vfe_disable_soc_resources(struct cam_hw_soc_info *soc_info)
		return rc;
	}

	rc = cam_cpas_stop(soc_private->cpas_handle);
	rc = cam_cpas_stop(soc_private->cpas_handle[0]);
	if (rc) {
		CAM_ERR(CAM_ISP, "Error! CPAS stop failed rc=%d", rc);
		return rc;
	}

	if (!rc && soc_private->cpas_version == CAM_CPAS_TITAN_175_V120)
		rc = cam_cpas_stop(soc_private->cpas_handle[1]);
		if (rc) {
			CAM_ERR(CAM_ISP, "Error! CPAS stop failed rc=%d", rc);
			return rc;
+9 −1
Original line number Diff line number Diff line
@@ -18,6 +18,12 @@

#define CAM_VFE_DSP_CLK_NAME "ife_dsp_clk"

enum cam_cpas_handle_id {
	CAM_CPAS_HANDLE_CAMIF,
	CAM_CPAS_HANDLE_RAW,
	CAM_CPAS_HANDLE_MAX,
};

/*
 * struct cam_vfe_soc_private:
 *
@@ -26,9 +32,11 @@
 * @cpas_handle:             Handle returned on registering with CPAS driver.
 *                           This handle is used for all further interface
 *                           with CPAS.
 * @cpas_version:            Has cpas version read from Hardware
 */
struct cam_vfe_soc_private {
	uint32_t    cpas_handle;
	uint32_t    cpas_handle[CAM_CPAS_HANDLE_MAX];
	uint32_t    cpas_version;
	struct clk *dsp_clk;
	int32_t     dsp_clk_index;
	int32_t     dsp_clk_rate;
+32 −18
Original line number Diff line number Diff line
@@ -212,8 +212,7 @@ static int cam_vfe_camif_resource_start(
	uint32_t                             epoch0_irq_mask;
	uint32_t                             epoch1_irq_mask;
	uint32_t                             computed_epoch_line_cfg;
	uint32_t                             camera_hw_version = 0;
	int                                  rc = 0;
	struct cam_vfe_soc_private          *soc_private;

	if (!camif_res) {
		CAM_ERR(CAM_ISP, "Error! Invalid input arguments");
@@ -228,6 +227,13 @@ static int cam_vfe_camif_resource_start(

	rsrc_data = (struct cam_vfe_mux_camif_data  *)camif_res->res_priv;

	soc_private = rsrc_data->soc_info->soc_private;

	if (!soc_private) {
		CAM_ERR(CAM_ISP, "Error! soc_private NULL");
		return -ENODEV;
	}

	/*config vfe core*/
	val = (rsrc_data->pix_pattern <<
			rsrc_data->reg_data->pixel_pattern_shift);
@@ -253,16 +259,8 @@ static int cam_vfe_camif_resource_start(
		rsrc_data->common_reg->module_ctrl[
		CAM_VFE_TOP_VER2_MODULE_STATS]->cgc_ovd);

	/* get the HW version */
	rc = cam_cpas_get_cpas_hw_version(&camera_hw_version);

	if (rc) {
		CAM_ERR(CAM_ISP, "Couldn't find HW version. rc: %d", rc);
		return rc;
	}

	/* epoch config */
	switch (camera_hw_version) {
	switch (soc_private->cpas_version) {
	case CAM_CPAS_TITAN_175_V101:
	case CAM_CPAS_TITAN_175_V100:
		epoch0_irq_mask = ((rsrc_data->last_line -
@@ -295,7 +293,7 @@ static int cam_vfe_camif_resource_start(
				rsrc_data->mem_base +
				rsrc_data->camif_reg->epoch_irq);
		CAM_WARN(CAM_ISP, "Hardware version not proper: 0x%x",
				camera_hw_version);
			soc_private->cpas_version);
		break;
	}

@@ -368,14 +366,30 @@ static int cam_vfe_camif_reg_dump(
		CAM_INFO(CAM_ISP, "offset 0x%x val 0x%x", i, val);
	}

	cam_cpas_reg_read(soc_private->cpas_handle,
	if (soc_private->cpas_version == CAM_CPAS_TITAN_175_V120) {
		cam_cpas_reg_read(soc_private->cpas_handle[0],
			CAM_CPAS_REG_CAMNOC, 0x3A20, true, &val);
		CAM_INFO(CAM_ISP, "IFE0_nRDI_MAXWR_LOW offset 0x3A20 val 0x%x",
			val);

		cam_cpas_reg_read(soc_private->cpas_handle[0],
			CAM_CPAS_REG_CAMNOC, 0x5420, true, &val);
		CAM_INFO(CAM_ISP, "IFE1_nRDI_MAXWR_LOW offset 0x5420 val 0x%x",
			val);

		cam_cpas_reg_read(soc_private->cpas_handle[1],
			CAM_CPAS_REG_CAMNOC, 0x3620, true, &val);
		CAM_INFO(CAM_ISP,
			"IFE0123_RDI_WR_MAXWR_LOW offset 0x3620 val 0x%x", val);
	} else {
		cam_cpas_reg_read(soc_private->cpas_handle[0],
			CAM_CPAS_REG_CAMNOC, 0x420, true, &val);
		CAM_INFO(CAM_ISP, "IFE02_MAXWR_LOW offset 0x420 val 0x%x", val);

	cam_cpas_reg_read(soc_private->cpas_handle,
		cam_cpas_reg_read(soc_private->cpas_handle[0],
			CAM_CPAS_REG_CAMNOC, 0x820, true, &val);
		CAM_INFO(CAM_ISP, "IFE13_MAXWR_LOW offset 0x820 val 0x%x", val);

	}
	return rc;
}

+110 −65
Original line number Diff line number Diff line
@@ -37,11 +37,13 @@ struct cam_vfe_top_ver2_priv {
	struct cam_axi_vote                 applied_axi_vote;
	struct cam_axi_vote             req_axi_vote[CAM_VFE_TOP_VER2_MUX_MAX];
	unsigned long                   req_clk_rate[CAM_VFE_TOP_VER2_MUX_MAX];
	struct cam_axi_vote             last_vote[CAM_VFE_TOP_VER2_MUX_MAX *
	struct cam_axi_vote             last_vote[CAM_CPAS_HANDLE_MAX]
					[CAM_VFE_TOP_VER2_MUX_MAX *
					CAM_VFE_DELAY_BW_REDUCTION_NUM_FRAMES];
	uint32_t                        last_counter;
	uint32_t                        last_counter[CAM_CPAS_HANDLE_MAX];
	enum cam_vfe_bw_control_action
		axi_vote_control[CAM_VFE_TOP_VER2_MUX_MAX];
	enum cam_cpas_handle_id cpashdl_type[CAM_VFE_TOP_VER2_MUX_MAX];
};

static int cam_vfe_top_mux_get_base(struct cam_vfe_top_ver2_priv *top_priv,
@@ -133,15 +135,31 @@ static int cam_vfe_top_set_axi_bw_vote(
	struct cam_vfe_soc_private *soc_private =
		soc_info->soc_private;
	bool apply_bw_update = false;
	enum cam_cpas_handle_id cpashdl_type;
	struct cam_axi_vote *last_vote = NULL;

	if (!soc_private) {
		CAM_ERR(CAM_ISP, "Error soc_private NULL");
		return -EINVAL;
	}

	for (cpashdl_type = 0; cpashdl_type < CAM_CPAS_HANDLE_MAX;
		cpashdl_type++) {

		if ((soc_private->cpas_version != CAM_CPAS_TITAN_175_V120)
			&& cpashdl_type)
			continue;

		sum.uncompressed_bw = sum.compressed_bw = 0;
		to_be_applied_axi_vote.uncompressed_bw = 0;
		to_be_applied_axi_vote.compressed_bw = 0;
		apply_bw_update = false;

		for (i = 0; i < CAM_VFE_TOP_VER2_MUX_MAX; i++) {
			if (top_priv->axi_vote_control[i] ==
			CAM_VFE_BW_CONTROL_INCLUDE) {
				CAM_VFE_BW_CONTROL_INCLUDE &&
				top_priv->cpashdl_type[i] ==
				cpashdl_type) {
				sum.uncompressed_bw +=
				top_priv->req_axi_vote[i].uncompressed_bw;
				sum.compressed_bw +=
@@ -155,8 +173,11 @@ static int cam_vfe_top_set_axi_bw_vote(
			sum.uncompressed_bw,
			sum.compressed_bw);

	top_priv->last_vote[top_priv->last_counter] = sum;
	top_priv->last_counter = (top_priv->last_counter + 1) %
		last_vote = top_priv->last_vote[cpashdl_type];

		last_vote[top_priv->last_counter[cpashdl_type]] = sum;
		top_priv->last_counter[cpashdl_type] =
			(top_priv->last_counter[cpashdl_type] + 1) %
			(CAM_VFE_TOP_VER2_MUX_MAX *
			CAM_VFE_DELAY_BW_REDUCTION_NUM_FRAMES);

@@ -171,34 +192,33 @@ static int cam_vfe_top_set_axi_bw_vote(
		}

		if (start_stop == true) {
		/* need to vote current request immediately */
		to_be_applied_axi_vote = sum;
		/* Reset everything, we can start afresh */
		memset(top_priv->last_vote, 0x0, sizeof(struct cam_axi_vote) *
			(CAM_VFE_TOP_VER2_MUX_MAX *
			CAM_VFE_DELAY_BW_REDUCTION_NUM_FRAMES));
		top_priv->last_counter = 0;
		top_priv->last_vote[top_priv->last_counter] = sum;
		top_priv->last_counter = (top_priv->last_counter + 1) %
			(CAM_VFE_TOP_VER2_MUX_MAX *
			CAM_VFE_DELAY_BW_REDUCTION_NUM_FRAMES);
	} else {
			rc = cam_cpas_update_axi_vote(
				soc_private->cpas_handle[cpashdl_type],
				&to_be_applied_axi_vote);
			if (!rc) {
				top_priv->applied_axi_vote.uncompressed_bw =
					to_be_applied_axi_vote.uncompressed_bw;
				top_priv->applied_axi_vote.compressed_bw =
					to_be_applied_axi_vote.compressed_bw;
			}
			return rc;
		}

		/*
		 * Find max bw request in last few frames. This will the bw
		 * Find max bw request in last few frames. This is the bw
		 * that we want to vote to CPAS now.
		 */
		for (i = 0; i < (CAM_VFE_TOP_VER2_MUX_MAX *
			CAM_VFE_DELAY_BW_REDUCTION_NUM_FRAMES); i++) {
			if (to_be_applied_axi_vote.compressed_bw <
				top_priv->last_vote[i].compressed_bw)
				last_vote[i].compressed_bw)
				to_be_applied_axi_vote.compressed_bw =
					top_priv->last_vote[i].compressed_bw;
					last_vote[i].compressed_bw;

			if (to_be_applied_axi_vote.uncompressed_bw <
				top_priv->last_vote[i].uncompressed_bw)
					last_vote[i].uncompressed_bw)
				to_be_applied_axi_vote.uncompressed_bw =
					top_priv->last_vote[i].uncompressed_bw;
		}
					last_vote[i].uncompressed_bw;
		}

		if ((to_be_applied_axi_vote.uncompressed_bw !=
@@ -211,7 +231,7 @@ static int cam_vfe_top_set_axi_bw_vote(

		if (apply_bw_update == true) {
			rc = cam_cpas_update_axi_vote(
			soc_private->cpas_handle,
				soc_private->cpas_handle[cpashdl_type],
				&to_be_applied_axi_vote);
			if (!rc) {
				top_priv->applied_axi_vote.uncompressed_bw =
@@ -219,10 +239,11 @@ static int cam_vfe_top_set_axi_bw_vote(
				top_priv->applied_axi_vote.compressed_bw =
					to_be_applied_axi_vote.compressed_bw;
			} else {
			CAM_ERR(CAM_ISP, "BW request failed, rc=%d", rc);
				CAM_ERR(CAM_ISP, "BW request failed, rc=%d",
					rc);
			}
		}
	}

	return rc;
}

@@ -669,6 +690,7 @@ int cam_vfe_top_ver2_init(
	struct cam_vfe_top_ver2_priv           *top_priv = NULL;
	struct cam_vfe_top_ver2_hw_info        *ver2_hw_info = top_hw_info;
	struct cam_vfe_top                     *vfe_top;
	struct cam_vfe_soc_private             *soc_private = NULL;

	vfe_top = kzalloc(sizeof(struct cam_vfe_top), GFP_KERNEL);
	if (!vfe_top) {
@@ -684,14 +706,22 @@ int cam_vfe_top_ver2_init(
		rc = -ENOMEM;
		goto free_vfe_top;
	}

	soc_private = soc_info->soc_private;
	if (!soc_private) {
		CAM_ERR(CAM_ISP, "Error! soc_private NULL");
		rc = -ENODEV;
		goto free_vfe_top_priv;
	}
	vfe_top->top_priv = top_priv;
	top_priv->hw_clk_rate = 0;
	top_priv->applied_axi_vote.compressed_bw = 0;
	top_priv->applied_axi_vote.uncompressed_bw = 0;
	memset(top_priv->last_vote, 0x0, sizeof(struct cam_axi_vote) *
		(CAM_VFE_TOP_VER2_MUX_MAX *
		(CAM_VFE_TOP_VER2_MUX_MAX * CAM_CPAS_HANDLE_MAX *
		CAM_VFE_DELAY_BW_REDUCTION_NUM_FRAMES));
	top_priv->last_counter = 0;
	top_priv->last_counter[0] = 0;
	top_priv->last_counter[1] = 0;

	for (i = 0, j = 0; i < CAM_VFE_TOP_VER2_MUX_MAX; i++) {
		top_priv->mux_rsrc[i].res_type = CAM_ISP_RESOURCE_VFE_IN;
@@ -707,6 +737,7 @@ int cam_vfe_top_ver2_init(
		if (ver2_hw_info->mux_type[i] == CAM_VFE_CAMIF_VER_2_0) {
			top_priv->mux_rsrc[i].res_id =
				CAM_ISP_HW_VFE_IN_CAMIF;
			top_priv->cpashdl_type[i] = CAM_CPAS_HANDLE_CAMIF;

			rc = cam_vfe_camif_ver2_init(hw_intf, soc_info,
				&ver2_hw_info->camif_hw_info,
@@ -717,6 +748,13 @@ int cam_vfe_top_ver2_init(
			CAM_VFE_CAMIF_LITE_VER_2_0) {
			top_priv->mux_rsrc[i].res_id =
				CAM_ISP_HW_VFE_IN_CAMIF_LITE;
			if (soc_private->cpas_version ==
				CAM_CPAS_TITAN_175_V120)
				top_priv->cpashdl_type[i] =
					CAM_CPAS_HANDLE_RAW;
			else
				top_priv->cpashdl_type[i] =
					CAM_CPAS_HANDLE_CAMIF;

			rc = cam_vfe_camif_lite_ver2_init(hw_intf, soc_info,
				&ver2_hw_info->camif_lite_hw_info,
@@ -729,6 +767,13 @@ int cam_vfe_top_ver2_init(
			/* set the RDI resource id */
			top_priv->mux_rsrc[i].res_id =
				CAM_ISP_HW_VFE_IN_RDI0 + j++;
			if (soc_private->cpas_version ==
				CAM_CPAS_TITAN_175_V120)
				top_priv->cpashdl_type[i] =
					CAM_CPAS_HANDLE_RAW;
			else
				top_priv->cpashdl_type[i] =
					CAM_CPAS_HANDLE_CAMIF;

			rc = cam_vfe_rdi_ver2_init(hw_intf, soc_info,
				&ver2_hw_info->rdi_hw_info,
@@ -776,7 +821,7 @@ int cam_vfe_top_ver2_init(
		top_priv->mux_rsrc[i].res_state =
			CAM_ISP_RESOURCE_STATE_UNAVAILABLE;
	}

free_vfe_top_priv:
	kfree(vfe_top->top_priv);
free_vfe_top:
	kfree(vfe_top);