summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-01-05 08:39:49 -0600
committerTom Rini <[email protected]>2026-01-05 08:39:49 -0600
commit228810d0bac3aae708d65f16e7b5aa9f8e197e9f (patch)
treed352c21c1c99db2759abf81ba2ff4b0acac46f72
parenteb18217b63b79dfcec704d420fcc61e77397c88f (diff)
parent4c3aa5356dd141c07e764580807c33eaae990038 (diff)
Merge tag 'scmi-master-2026-1-5' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq
CI: https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq/-/pipelines/28902 - Fix non-CCF priv initialization in scmi_clk_gate() - Fix typo in scmi_clk_get_attibute() - Remove duplicated scmi_generic_protocol_version() request
-rw-r--r--drivers/clk/clk_scmi.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/clk/clk_scmi.c b/drivers/clk/clk_scmi.c
index 683ac822a01..ee237ed6337 100644
--- a/drivers/clk/clk_scmi.c
+++ b/drivers/clk/clk_scmi.c
@@ -87,8 +87,8 @@ static int scmi_clk_get_num_clock(struct udevice *dev, size_t *num_clocks)
return 0;
}
-static int scmi_clk_get_attibute(struct udevice *dev, int clkid, char *name,
- u32 *attr)
+static int scmi_clk_get_attribute(struct udevice *dev, int clkid, char *name,
+ u32 *attr)
{
struct scmi_clock_priv *priv = dev_get_priv(dev);
struct scmi_clk_attribute_in in = {
@@ -137,7 +137,7 @@ static int scmi_clk_get_attibute(struct udevice *dev, int clkid, char *name,
static int scmi_clk_gate(struct clk *clk, int enable)
{
- struct scmi_clock_priv *priv = dev_get_parent_priv(clk->dev);
+ struct scmi_clock_priv *priv;
struct scmi_clk_state_in_v1 in_v1 = {
.clock_id = clk_get_id(clk),
.attributes = enable,
@@ -156,6 +156,16 @@ static int scmi_clk_gate(struct clk *clk, int enable)
in_v2, out);
int ret;
+ /*
+ * In scmi_clk_probe(), in case of CLK_CCF is set, SCMI clock
+ * version is set in dev's parent priv struct. Otherwise
+ * SCMI clock version is set in dev priv struct.
+ */
+ if (CONFIG_IS_ENABLED(CLK_CCF))
+ priv = dev_get_parent_priv(clk->dev);
+ else
+ priv = dev_get_priv(clk->dev);
+
ret = devm_scmi_process_msg(clk->dev,
(priv->version < CLOCK_PROTOCOL_VERSION_2_1) ?
&msg_v1 : &msg_v2);
@@ -183,8 +193,8 @@ static int scmi_clk_get_ctrl_flags(struct clk *clk, u32 *ctrl_flags)
if (!clkscmi->attrs_resolved) {
char name[SCMI_CLOCK_NAME_LENGTH_MAX];
- ret = scmi_clk_get_attibute(dev, clk->id & CLK_ID_MSK,
- name, &attributes);
+ ret = scmi_clk_get_attribute(dev, clk->id & CLK_ID_MSK,
+ name, &attributes);
if (ret)
return ret;
@@ -334,9 +344,6 @@ static int scmi_clk_probe(struct udevice *dev)
if (!CONFIG_IS_ENABLED(CLK_CCF))
return 0;
- ret = scmi_generic_protocol_version(dev, SCMI_PROTOCOL_ID_CLOCK,
- &priv->version);
-
/* register CCF children: CLK UCLASS, no probed again */
if (device_get_uclass_id(dev->parent) == UCLASS_CLK)
return 0;