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

Commit 7b08eb6d authored by Venkat Chinta's avatar Venkat Chinta Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: cpas: Remove duplicate code and add unlock mutex



This change removes duplicate code that was introduced as part
of the driver upgrade port from msm-4.9 branch. It also adds
unlock mutex that was omitted by the same upgrade.

Change-Id: Idc86129fd1510d6a0de2986447465f30d4096054
Signed-off-by: default avatarVenkat Chinta <vchinta@codeaurora.org>
parent a304a254
Loading
Loading
Loading
Loading
+1 −13
Original line number Diff line number Diff line
@@ -523,7 +523,6 @@ static int cam_cpas_hw_reg_read(struct cam_hw_info *cpas_hw,
	if (!CAM_CPAS_CLIENT_VALID(client_indx))
		return -EINVAL;

	mutex_lock(&cpas_hw->hw_mutex);
	mutex_lock(&cpas_core->client_mutex[client_indx]);
	cpas_client = cpas_core->cpas_client[client_indx];

@@ -546,7 +545,6 @@ static int cam_cpas_hw_reg_read(struct cam_hw_info *cpas_hw,

unlock_client:
	mutex_unlock(&cpas_core->client_mutex[client_indx]);
	mutex_unlock(&cpas_hw->hw_mutex);
	return rc;
}

@@ -661,9 +659,6 @@ static int cam_cpas_util_apply_client_axi_vote(
	axi_port->consolidated_axi_vote.compressed_bw = mnoc_bw;
	axi_port->consolidated_axi_vote.uncompressed_bw = camnoc_bw;

	axi_port->consolidated_axi_vote.compressed_bw = mnoc_bw;
	axi_port->consolidated_axi_vote.uncompressed_bw = camnoc_bw;

	CAM_DBG(CAM_CPAS,
		"axi[(%d, %d),(%d, %d)] : camnoc_bw[%llu], mnoc_bw[%llu]",
		axi_port->mnoc_bus.src, axi_port->mnoc_bus.dst,
@@ -698,14 +693,6 @@ static int cam_cpas_util_apply_client_axi_vote(

	return rc;

	mutex_unlock(&axi_port->lock);

	rc = cam_cpas_util_set_camnoc_axi_clk_rate(cpas_hw);
	if (rc)
		CAM_ERR(CAM_CPAS, "Failed in setting axi clk rate rc=%d", rc);

	return rc;

unlock_axi_port:
	mutex_unlock(&axi_port->lock);
	return rc;
@@ -925,6 +912,7 @@ static int cam_cpas_hw_update_ahb_vote(struct cam_hw_info *cpas_hw,

unlock_client:
	mutex_unlock(&cpas_core->client_mutex[client_indx]);
	mutex_unlock(&cpas_hw->hw_mutex);
	return rc;
}

+0 −41
Original line number Diff line number Diff line
@@ -45,18 +45,6 @@ int cam_cpas_get_custom_dt_info(struct platform_device *pdev,
	}


	soc_private->hw_version = 0;
	rc = of_property_read_u32(of_node,
		"qcom,cpas-hw-ver", &soc_private->hw_version);
	if (rc) {
		CAM_ERR(CAM_CPAS, "device %s failed to read cpas-hw-ver",
			pdev->name);
		return rc;
	}

	CAM_DBG(CAM_CPAS, "CPAS HW VERSION %x", soc_private->hw_version);


	soc_private->hw_version = 0;
	rc = of_property_read_u32(of_node,
		"qcom,cpas-hw-ver", &soc_private->hw_version);
@@ -161,35 +149,6 @@ int cam_cpas_get_custom_dt_info(struct platform_device *pdev,
		}
	}

	CAM_DBG(CAM_CPAS,
		"control_camnoc_axi_clk=%d, width=%d, margin=%d",
		soc_private->control_camnoc_axi_clk,
		soc_private->camnoc_bus_width,
		soc_private->camnoc_axi_clk_bw_margin);

	soc_private->control_camnoc_axi_clk = of_property_read_bool(of_node,
		"control-camnoc-axi-clk");

	if (soc_private->control_camnoc_axi_clk == true) {
		rc = of_property_read_u32(of_node, "camnoc-bus-width",
			&soc_private->camnoc_bus_width);
		if (rc || (soc_private->camnoc_bus_width == 0)) {
			CAM_ERR(CAM_CPAS, "Bus width not found rc=%d, %d",
				rc, soc_private->camnoc_bus_width);
			return rc;
		}

		rc = of_property_read_u32(of_node,
			"camnoc-axi-clk-bw-margin-perc",
			&soc_private->camnoc_axi_clk_bw_margin);

		if (rc) {
			/* this is not fatal, overwrite rc */
			rc = 0;
			soc_private->camnoc_axi_clk_bw_margin = 0;
		}
	}

	CAM_DBG(CAM_CPAS,
		"control_camnoc_axi_clk=%d, width=%d, margin=%d",
		soc_private->control_camnoc_axi_clk,