[PATCH 1/3] clk: Introduce clk_hw_set_spread_spectrum

Peng Fan peng.fan at oss.nxp.com
Fri Aug 29 02:08:13 PDT 2025


On Wed, Aug 27, 2025 at 11:45:19AM -0400, Brian Masney wrote:
>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 at 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?

Yeah. Dan has raised similar comment, I will change to use
struct clk_spread_spectrum as the 2nd param.

Thanks,
Peng

>
>Brian
>



More information about the linux-arm-kernel mailing list