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

Commit b6d9b31c authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera_v2: Disable CPP clock source during camera close"

parents 5f24c489 50e37ff6
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -426,24 +426,6 @@ int msm_camera_clk_enable(struct device *dev,
}
EXPORT_SYMBOL(msm_camera_clk_enable);


int msm_camera_cpp_clk_disable(struct device *dev,
		struct msm_cam_clk_info *clk_info,
		struct clk **clk_ptr, int num_clk, int enable)
{
	int i;
	int rc = 1;

	for (i = num_clk - 1; i >= 0; i--) {
		if (clk_ptr[i] != NULL) {
			rc = strcmp(clk_info[i].clk_name, "cpp_src_clk");
			if (rc == 0)
				continue;
			clk_disable_unprepare(clk_ptr[i]);
		}
	}
	return 0;
}
/* Set rate on a specific clock */
long msm_camera_clk_set_rate(struct device *dev,
			struct clk *clk,
+0 −4
Original line number Diff line number Diff line
@@ -174,10 +174,6 @@ int msm_camera_clk_enable(struct device *dev,
		int num_clk,
		int enable);

int msm_camera_cpp_clk_disable(struct device *dev,
		struct msm_cam_clk_info *clk_info,
		struct clk **clk_ptr, int num_clk, int enable);

/**
 * @brief      : Set clock rate
 *
+4 −3
Original line number Diff line number Diff line
@@ -1204,11 +1204,12 @@ static void cpp_release_hardware(struct cpp_device *cpp_dev)
	if (cam_config_ahb_clk(NULL, 0, CAM_AHB_CLIENT_CPP,
		CAM_AHB_SUSPEND_VOTE) < 0)
		pr_err("%s: failed to remove vote for AHB\n", __func__);
	msm_camera_cpp_clk_disable(&cpp_dev->pdev->dev, cpp_dev->clk_info,
	msm_camera_clk_enable(&cpp_dev->pdev->dev, cpp_dev->clk_info,
		cpp_dev->cpp_clk, cpp_dev->num_clks, false);
	msm_camera_regulator_disable(cpp_dev->cpp_vdd, cpp_dev->num_reg, true);
	if (cpp_dev->stream_cnt > 0) {
		pr_warn("stream count active\n");
	if ((cpp_dev->stream_cnt > 0) || (cpp_dev->cpp_open_cnt == 0)) {
		pr_debug("stream count active %d and close cpp node %d\n",
			cpp_dev->stream_cnt, cpp_dev->cpp_open_cnt);
		rc = msm_cpp_update_bandwidth_setting(cpp_dev, 0, 0);
	}
	cpp_dev->stream_cnt = 0;