Re: [PATCH 1/3] clk: Introduce clk_hw_set_spread_spectrum
From: Brian Masney <bmasney@redhat.com>
Date: 2025-08-27 15:45:26
Also in:
arm-scmi, linux-clk, lkml
From: Brian Masney <bmasney@redhat.com>
Date: 2025-08-27 15:45:26
Also in:
arm-scmi, linux-clk, lkml
On Tue, Aug 12, 2025 at 08:17:05PM +0800, Peng Fan wrote:
Add clk_hw_set_spread_spectrum to configure a clock to enable spread spectrum feature. set_spread_spectrum ops is added for clk drivers to have their own hardware specific implementation. Signed-off-by: Peng Fan <peng.fan@nxp.com> --- drivers/clk/clk.c | 32 ++++++++++++++++++++++++++++++++ include/linux/clk-provider.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+)diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index b821b2cdb155331c85fafbd2fac8ab3703a08e4d..48c7a301b72b30fd824dae7ada2c44ee84d40867 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c@@ -2802,6 +2802,38 @@ int clk_set_max_rate(struct clk *clk, unsigned long rate) } EXPORT_SYMBOL_GPL(clk_set_max_rate); +int clk_hw_set_spread_spectrum(struct clk_hw *hw, unsigned int modfreq_hz, + unsigned int spread_bp, unsigned int method)
^^^^^^^^^^^^ Should this be 'enum clk_ssc_method'? Also can you add kernel docs for all of the parameters? I know it's documented on 'struct clk_spread_spectrum' below. What do you think about having this function take that struct instead as a parameter to match what's on the clk op? Brian