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

Commit afbd5633 authored by Deepak Cherian's avatar Deepak Cherian Committed by Cherian Deepak
Browse files

msm: camera: sensor: Round the clock rate before setting



clock has different rates. Once desired clock rate is calculated,
call clk_roundrate() to get supported clk rate and set it using
clk_setrate().So we rounded the desired clock rate to get the
supported value for the corresponding modules.

Change-Id: I8e35626dd39e60cc57711bf16cd3c655471ea64c
Signed-off-by: default avatarCherian Deepak <dcheri@codeaurora.org>
parent a0bba46a
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -147,13 +147,21 @@ int msm_cam_clk_enable(struct device *dev, struct msm_cam_clk_info *clk_info,
				goto cam_clk_get_err;
			}
			if (clk_info[i].clk_rate > 0) {
				rc = clk_set_rate(clk_ptr[i],
				clk_rate = clk_round_rate(clk_ptr[i],
					clk_info[i].clk_rate);
				if (clk_rate < 0) {
					pr_err("%s round failed\n",
						   clk_info[i].clk_name);
					goto cam_clk_set_err;
				}
				rc = clk_set_rate(clk_ptr[i],
					clk_rate);
				if (rc < 0) {
					pr_err("%s set failed\n",
						clk_info[i].clk_name);
					goto cam_clk_set_err;
				}

			} else if (clk_info[i].clk_rate == INIT_RATE) {
				clk_rate = clk_get_rate(clk_ptr[i]);
				if (clk_rate == 0) {