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

Commit d6de8c8e authored by Venkat Chinta's avatar Venkat Chinta Committed by Pavan Kumar Chilamkurthi
Browse files

msm: camera: icp: Return CAM_MAX_VOTE if matching index not found



If no matching index found in the clk info clk rate table
for the input base_clk rate, i.e if base_clk rate value
is greater than the max value in the clk info table,
return CAM_MAX_VOTE so that caller knows the passed base clk
value is higher than max value in the clk table. This helps
in determining whether the clk is overclocked and thus
reducing as required.

Change-Id: I852ac506aaa6067bbd053fe36bb235d26913819e
Signed-off-by: default avatarVenkat Chinta <vchinta@codeaurora.org>
Signed-off-by: default avatarPavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
parent c092e59f
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -116,7 +116,12 @@ static int cam_icp_get_actual_clk_rate_idx(
		if (ctx_data->clk_info.clk_rate[i] >= base_clk)
			return i;

	return 0;
	/*
	 * Caller has to ensure returned index is within array
	 * size bounds while accessing that index.
	 */

	return i;
}

static bool cam_icp_is_over_clk(struct cam_icp_hw_mgr *hw_mgr,
@@ -132,7 +137,7 @@ static bool cam_icp_is_over_clk(struct cam_icp_hw_mgr *hw_mgr,
	curr_clk_idx = cam_icp_get_actual_clk_rate_idx(ctx_data,
		hw_mgr_clk_info->curr_clk);

	CAM_DBG(CAM_ICP, "bc_idx = %d cc_idx = %d %lld %lld",
	CAM_DBG(CAM_ICP, "bc_idx = %d cc_idx = %d %d %d",
		base_clk_idx, curr_clk_idx, hw_mgr_clk_info->base_clk,
		hw_mgr_clk_info->curr_clk);