diff options
author | Cristian Marussi <cristian.marussi@arm.com> | 2024-04-15 17:36:47 +0100 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2024-04-22 17:17:08 -0700 |
commit | c3ad1d0a7ef28bc503caf3d5242f2dda55df5d3f (patch) | |
tree | 4ca784283c51b3076bf5a52f037e333e41d9302f /drivers/clk/clk-scmi.c | |
parent | a1b8faf8784c434444432008b57274c8935cca5c (diff) |
clk: scmi: Add support for rate change restricted clocks
Some exposed SCMI Clocks could be marked as non-supporting rate changes.
Configure a clk_ops descriptors which does not provide the rate change
callbacks for such clocks when registering with CLK framework.
CC: Michael Turquette <mturquette@baylibre.com>
CC: Stephen Boyd <sboyd@kernel.org>
CC: linux-clk@vger.kernel.org
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240415163649.895268-4-cristian.marussi@arm.com
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk-scmi.c')
-rw-r--r-- | drivers/clk/clk-scmi.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c index e70708573965..ba234b56f742 100644 --- a/drivers/clk/clk-scmi.c +++ b/drivers/clk/clk-scmi.c @@ -20,6 +20,7 @@ enum scmi_clk_feats { SCMI_CLK_ATOMIC_SUPPORTED, SCMI_CLK_STATE_CTRL_SUPPORTED, + SCMI_CLK_RATE_CTRL_SUPPORTED, SCMI_CLK_FEATS_COUNT }; @@ -248,7 +249,8 @@ scmi_clk_ops_alloc(struct device *dev, unsigned long feats_key) ops->recalc_rate = scmi_clk_recalc_rate; ops->round_rate = scmi_clk_round_rate; ops->determine_rate = scmi_clk_determine_rate; - ops->set_rate = scmi_clk_set_rate; + if (feats_key & BIT(SCMI_CLK_RATE_CTRL_SUPPORTED)) + ops->set_rate = scmi_clk_set_rate; /* Parent ops */ ops->get_parent = scmi_clk_get_parent; @@ -302,6 +304,9 @@ scmi_clk_ops_select(struct scmi_clk *sclk, bool atomic_capable, if (!ci->state_ctrl_forbidden) feats_key |= BIT(SCMI_CLK_STATE_CTRL_SUPPORTED); + if (!ci->rate_ctrl_forbidden) + feats_key |= BIT(SCMI_CLK_RATE_CTRL_SUPPORTED); + if (WARN_ON(feats_key >= db_size)) return NULL; |