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

Commit 61692529 authored by Devesh Jhunjhunwala's avatar Devesh Jhunjhunwala
Browse files

clk: msm: Add opp_table_populated flag to the clk struct



In some cases, populate_clock_opp_table may be called multiple
times on the same clk. To accommodate this, add a flag to the
clk struct which keeps track of whether the OPP table of the clk
is populated.

Change-Id: I91682b4d75a39fd757b871bfa74d11568a1655ac
Signed-off-by: default avatarDevesh Jhunjhunwala <deveshj@codeaurora.org>
parent 58be1b1f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1181,7 +1181,7 @@ static void populate_clock_opp_table(struct device_node *np,

		store_vcorner = false;
		clk = table[i].clk;
		if (!clk || !clk->num_fmax)
		if (!clk || !clk->num_fmax || clk->opp_table_populated)
			continue;

		if (strlen(clk->dbg_name) + LEN_OPP_HANDLE
@@ -1276,6 +1276,9 @@ static void populate_clock_opp_table(struct device_node *np,
			n++;
		}
err_round_rate:
		/* If OPP table population was successful, set the flag */
		if (uv >= 0 && ret >= 0)
			clk->opp_table_populated = true;
		kfree(device_list);
	}
}
+2 −0
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@ struct clk_ops {
 * @vdd_class: voltage scaling requirement class
 * @fmax: maximum frequency in Hz supported at each voltage level
 * @parent: the current source of this clock
 * @opp_table_populated: tracks if the OPP table of this clock has been filled
 */
struct clk {
	uint32_t flags;
@@ -193,6 +194,7 @@ struct clk {

	unsigned long init_rate;
	bool always_on;
	bool opp_table_populated;

	struct dentry *clk_dir;
};