[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240227194812.1209532-5-cristian.marussi@arm.com>
Date: Tue, 27 Feb 2024 19:48:11 +0000
From: Cristian Marussi <cristian.marussi@....com>
To: linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Cc: sudeep.holla@....com,
james.quinlan@...adcom.com,
f.fainelli@...il.com,
vincent.guittot@...aro.org,
peng.fan@....nxp.com,
michal.simek@....com,
quic_sibis@...cinc.com,
quic_nkela@...cinc.com,
mturquette@...libre.com,
sboyd@...nel.org,
souvik.chakravarty@....com,
Cristian Marussi <cristian.marussi@....com>,
linux-clk@...r.kernel.org
Subject: [PATCH 4/5] 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@...libre.com>
CC: Stephen Boyd <sboyd@...nel.org>
CC: linux-clk@...r.kernel.org
Signed-off-by: Cristian Marussi <cristian.marussi@....com>
---
drivers/clk/clk-scmi.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c
index d20dcc60f9d1..87e968b6c095 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_FORBIDDEN,
SCMI_CLK_RATE_CTRL_FORBIDDEN,
+ SCMI_CLK_PARENT_CTRL_FORBIDDEN,
SCMI_CLK_MAX_FEATS
};
@@ -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_FORBIDDEN)))
+ ops->set_parent = scmi_clk_set_parent;
return ops;
}
@@ -301,6 +303,9 @@ scmi_clk_ops_select(struct scmi_clk *sclk, bool atomic_capable,
if (ci->rate_ctrl_forbidden)
feats_key |= BIT(SCMI_CLK_RATE_CTRL_FORBIDDEN);
+ if (ci->parent_ctrl_forbidden)
+ feats_key |= BIT(SCMI_CLK_PARENT_CTRL_FORBIDDEN);
+
/* Lookup previously allocated ops */
ops = clk_ops_db[feats_key];
if (!ops) {
--
2.43.0
Powered by blists - more mailing lists