Skip to content

Commit fa23e09

Browse files
cris-mabebarino
authored andcommitted
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>
1 parent c3ad1d0 commit fa23e09

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/clk/clk-scmi.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ enum scmi_clk_feats {
2121
SCMI_CLK_ATOMIC_SUPPORTED,
2222
SCMI_CLK_STATE_CTRL_SUPPORTED,
2323
SCMI_CLK_RATE_CTRL_SUPPORTED,
24+
SCMI_CLK_PARENT_CTRL_SUPPORTED,
2425
SCMI_CLK_FEATS_COUNT
2526
};
2627

@@ -254,7 +255,8 @@ scmi_clk_ops_alloc(struct device *dev, unsigned long feats_key)
254255

255256
/* Parent ops */
256257
ops->get_parent = scmi_clk_get_parent;
257-
ops->set_parent = scmi_clk_set_parent;
258+
if (feats_key & BIT(SCMI_CLK_PARENT_CTRL_SUPPORTED))
259+
ops->set_parent = scmi_clk_set_parent;
258260

259261
return ops;
260262
}
@@ -307,6 +309,9 @@ scmi_clk_ops_select(struct scmi_clk *sclk, bool atomic_capable,
307309
if (!ci->rate_ctrl_forbidden)
308310
feats_key |= BIT(SCMI_CLK_RATE_CTRL_SUPPORTED);
309311

312+
if (!ci->parent_ctrl_forbidden)
313+
feats_key |= BIT(SCMI_CLK_PARENT_CTRL_SUPPORTED);
314+
310315
if (WARN_ON(feats_key >= db_size))
311316
return NULL;
312317

0 commit comments

Comments
 (0)