diff options
author | Cristian Marussi <cristian.marussi@arm.com> | 2024-04-15 18:36:48 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2024-04-23 02:17:11 +0200 |
commit | fa23e091236b812a6143cf0f49821d8f5a6b84fa (patch) | |
tree | 17e7b10ae4381f8c0ec94b9a8e16094e72b5c6bc /drivers/clk/clk-scmi.c | |
parent | clk: scmi: Add support for rate change restricted clocks (diff) | |
download | linux-fa23e091236b812a6143cf0f49821d8f5a6b84fa.tar.xz linux-fa23e091236b812a6143cf0f49821d8f5a6b84fa.zip |
clk: scmi: Add support for re-parenting restricted clocks
Some exposed SCMI Clocks could be marked as non-supporting re-parenting
changes.
Configure a clk_ops descriptor which does not provide the re-parenting
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-5-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 ba234b56f742..ce0f26ee632f 100644 --- a/drivers/clk/clk-scmi.c +++ b/drivers/clk/clk-scmi.c @@ -21,6 +21,7 @@ enum scmi_clk_feats { SCMI_CLK_ATOMIC_SUPPORTED, SCMI_CLK_STATE_CTRL_SUPPORTED, SCMI_CLK_RATE_CTRL_SUPPORTED, + SCMI_CLK_PARENT_CTRL_SUPPORTED, SCMI_CLK_FEATS_COUNT }; @@ -254,7 +255,8 @@ scmi_clk_ops_alloc(struct device *dev, unsigned long feats_key) /* Parent ops */ ops->get_parent = scmi_clk_get_parent; - ops->set_parent = scmi_clk_set_parent; + if (feats_key & BIT(SCMI_CLK_PARENT_CTRL_SUPPORTED)) + ops->set_parent = scmi_clk_set_parent; return ops; } @@ -307,6 +309,9 @@ scmi_clk_ops_select(struct scmi_clk *sclk, bool atomic_capable, if (!ci->rate_ctrl_forbidden) feats_key |= BIT(SCMI_CLK_RATE_CTRL_SUPPORTED); + if (!ci->parent_ctrl_forbidden) + feats_key |= BIT(SCMI_CLK_PARENT_CTRL_SUPPORTED); + if (WARN_ON(feats_key >= db_size)) return NULL; |