[PATCH v12 1/3] clk: scmi: fix SSC permyriad conversion

From: Dario Binacchi

Date: Wed Sep 02 2026 - 06:22:51 EST


The spread_bp field of struct clk_spread_spectrum holds the modulation
depth in permyriad (1/100 of a percent), as documented in
clk-provider.h and in the assigned-clock-sscs binding. The i.MX SCMI
OEM extension expects an integer percentage in extConfigValue[7:0].

The conversion divides spread_bp by 10000 instead of 100, so any valid
configuration is truncated to 0 (or to 1 for a 100% spread) and the
hardware is silently programmed with no spread at all.

Divide by 100 to correctly convert permyriad to percent.

Fixes: 77369b1e6a37 ("clk: scmi: Add i.MX95 OEM extension support for SCMI clock driver")
Signed-off-by: Dario Binacchi <dario.binacchi@xxxxxxxxxxxxxxxxxxxx>
---

(no changes since v1)

drivers/clk/clk-scmi-oem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-scmi-oem.c b/drivers/clk/clk-scmi-oem.c
index be11d359b4ec..3e56e91ae68c 100644
--- a/drivers/clk/clk-scmi-oem.c
+++ b/drivers/clk/clk-scmi-oem.c
@@ -44,7 +44,7 @@ scmi_clk_imx_set_spread_spectrum(struct clk_hw *hw,
* extConfigValue[24] - Enable/Disable
* extConfigValue[31:25] - Reserved
*/
- val = FIELD_PREP(SCMI_CLOCK_IMX_SS_PERCENTAGE_MASK, ss_conf->spread_bp / 10000);
+ val = FIELD_PREP(SCMI_CLOCK_IMX_SS_PERCENTAGE_MASK, ss_conf->spread_bp / 100);
val |= FIELD_PREP(SCMI_CLOCK_IMX_SS_MOD_FREQ_MASK, ss_conf->modfreq_hz);
if (ss_conf->method != CLK_SPREAD_NO)
val |= SCMI_CLOCK_IMX_SS_ENABLE_MASK;
--
2.43.0