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

Commit e86f0371 authored by Taniya Das's avatar Taniya Das
Browse files

clk: qcom: clk-rcg2: Fix DFS frequency table allocation



DFS controlled clock frequency table is allocated & updated when the
clock set rate is issued from the client driver. The end of frequency
table is marked with an extra zero-ed out entry, thus update the
allocation to take care of the same. While at it also add the ops to
list the supported rates for the DFS controlled clocks.

Change-Id: Ifad1014b69b83bf19d2bdba37a112f52b22da0a7
Signed-off-by: default avatarTaniya Das <tdas@codeaurora.org>
parent 766f56fd
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
// SPDX-License-Identifier: GPL-2.0
/*
/*
 * Copyright (c) 2013, 2018-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013, 2018-2020, The Linux Foundation. All rights reserved.
 */
 */


#include <linux/kernel.h>
#include <linux/kernel.h>
@@ -1469,7 +1469,7 @@ static int clk_rcg2_dfs_populate_freq_table(struct clk_rcg2 *rcg)
	struct freq_tbl *freq_tbl;
	struct freq_tbl *freq_tbl;
	int i, ret;
	int i, ret;


	freq_tbl = kcalloc(MAX_PERF_LEVEL, sizeof(*freq_tbl), GFP_KERNEL);
	freq_tbl = kcalloc(MAX_PERF_LEVEL + 1, sizeof(*freq_tbl), GFP_KERNEL);
	if (!freq_tbl)
	if (!freq_tbl)
		return -ENOMEM;
		return -ENOMEM;
	rcg->freq_tbl = freq_tbl;
	rcg->freq_tbl = freq_tbl;
@@ -1553,6 +1553,7 @@ static const struct clk_ops clk_rcg2_dfs_ops = {
	.get_parent = clk_rcg2_get_parent,
	.get_parent = clk_rcg2_get_parent,
	.determine_rate = clk_rcg2_dfs_determine_rate,
	.determine_rate = clk_rcg2_dfs_determine_rate,
	.recalc_rate = clk_rcg2_dfs_recalc_rate,
	.recalc_rate = clk_rcg2_dfs_recalc_rate,
	.list_rate = clk_rcg2_list_rate,
};
};


static int clk_rcg2_enable_dfs(const struct clk_rcg_dfs_data *data,
static int clk_rcg2_enable_dfs(const struct clk_rcg_dfs_data *data,