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

Commit c5e38e5d authored by Deepak Katragadda's avatar Deepak Katragadda Committed by Gerrit - the friendly Code Review server
Browse files

clk: qcom: clk-rcg2: Allow DFS clients to scale the RCG while its enabled



Currently, the clock driver does not allow for clock clients
to call set_rate() on the DFS enabled clocks while the RCG
is ON. This is to prevent any unvoting on resources that the
RCG might still be using. However, this new requirement could
mean that clients need to redesign their call flow around the
fact that DFS has been enabled/not.
To prevent any such churn on the client side, remove these
restrictions and leave it to the client to correctly call
the APIs.

Change-Id: Id2d87c4f9c7aed89c56084c72f8b1d2a16fe9189
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
Signed-off-by: default avatarTaniya Das <tdas@codeaurora.org>
parent 6f808a5a
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -151,9 +151,6 @@ static int clk_rcg2_set_parent(struct clk_hw *hw, u8 index)
	regmap_read(rcg->clkr.regmap, rcg->cmd_rcgr + rcg->cfg_off + CFG_REG,
		       &old_cfg);

	if (rcg->flags & DFS_ENABLE_RCG)
		return 0;

	ret = regmap_update_bits(rcg->clkr.regmap, rcg->cmd_rcgr +
			rcg->cfg_off + CFG_REG, CFG_SRC_SEL_MASK, cfg);
	if (ret)
@@ -387,8 +384,9 @@ static int clk_rcg2_configure(struct clk_rcg2 *rcg, const struct freq_tbl *f)
	struct clk_hw *hw = &rcg->clkr.hw;
	int ret, index = qcom_find_src_index(hw, rcg->parent_map, f->src);

	/* Skip configuration if DFS control has been enabled for the RCG. */
	if (rcg->flags & DFS_ENABLE_RCG)
		return -EPERM;
		return 0;

	if (index < 0)
		return index;
@@ -537,7 +535,7 @@ static int __clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate,
	}

	ret = clk_rcg2_configure(rcg, f);
	if (ret && ret != -EPERM)
	if (ret)
		return ret;

	if (rcg->flags & FORCE_ENABLE_RCG) {
@@ -1442,7 +1440,9 @@ int clk_rcg2_get_dfs_clock_rate(struct clk_rcg2 *clk, struct device *dev,
		"RCG flags %x\n", i, dfs_freq_tbl[i].freq, dfs_freq_tbl[i].src,
				dfs_freq_tbl[i].pre_div, dfs_freq_tbl[i].m,
				dfs_freq_tbl[i].n, rcg_flags);

	/* Skip the safe configuration if DFS has been enabled for the RCG. */
	if (clk->enable_safe_config)
		clk->enable_safe_config = false;
	clk->flags |= rcg_flags;
	clk->freq_tbl = dfs_freq_tbl;
err: