[PATCH v2 2/3] clk: spacemit: extract common ccu functions

Yixun Lan dlan at gentoo.org
Tue Dec 30 18:12:05 PST 2025


Hi Alex, Yao,

On 04:00 Tue 30 Dec     , Yao Zi wrote:
> On Mon, Dec 29, 2025 at 06:50:14PM -0600, Alex Elder wrote:
> > On 12/26/25 12:55 AM, Yixun Lan wrote:
> > > Refactor the probe function of SpacemiT's clock, and extract a common ccu
> > > file, so new clock driver added in the future can share the same code,
> > > which would lower the burden of maintenance. Since this commit changes the
> > > module name where the auxiliary device registered, the auxiliary device id
> > > need to be adjusted. Idea of the patch is come from review of K3 clock
> > > driver, please refer this disucssion [1].
> > 
> > I understand the point here, and it's just like the first patch:
> > you're extracting generic code out of the K1-specific file so a
> > new K3-specific source file can use it too.  This is really good.
> > 
> > However the end result should incorporate *only* generic code
> > in the generic file, and have the SoC-specific source files
> > contain everything else.
> > 
> > But as you have it now, the (new) generic probe function
> > contains special handling for "spacemit,k1-pll", and that's
> > not generic.
> > 
> > So I suggest you still implement k1_ccu_probe() (and k3_ccu_probe())
> > separately, allowing each of them to do platform-specific things
> > before (and/or after) calling the generic probe function.
> 
> I've raised similar concerns in the series for K3 clock tree[1].
> 
> Regards,
> Yao Zi
> 
> [1]: https://lore.kernel.org/all/aU50DIe9qMneb0GT@pie/
> 

Ok, since both of you raise this, I will do it in next version
thanks

-- 
Yixun Lan (dlan)



More information about the linux-riscv mailing list