Re: [PATCH v3] ASoC: simple-card-utils: add sysclk ordering support

From: Kuninori Morimoto

Date: Wed Feb 11 2026 - 22:14:03 EST



Hi Stefano

> > When simple-audio-card programs sysclk for CPU and codec DAIs during
> > hw_params, the ordering of these calls may matter on some platforms.
> >
> > Some CPU DAIs finalize or adjust the MCLK rate as part of their
> > set_sysclk() callback (for example by calling clk_set_rate()). If the
> > codec sysclk is configured before the CPU DAI applies the final MCLK
> > rate, the codec may configure its internal clocking based on a
> > non-final MCLK value.
> >
> > Such situations can arise depending on the clock provider/consumer
> > relationship between the CPU DAI and the codec.
> >
> > Introduce an explicit sysclk ordering enum in simple-card-utils and use
> > it to control the order of snd_soc_dai_set_sysclk() calls in the mclk-fs
> > handling path. The default behaviour remains unchanged (codec-first)
> > to avoid regressions.
> >
> > Signed-off-by: Stefano Radaelli <stefano.r@xxxxxxxxxxxxx>
> > ---
> (snip)
> > +enum simple_util_sysclk_order {
> > + SIMPLE_SYSCLK_ORDER_UNSPEC = 0,
> > + SIMPLE_SYSCLK_ORDER_CODEC_FIRST,
> > + SIMPLE_SYSCLK_ORDER_CPU_FIRST,
> > +};
>
> I think UNSPEC is not needed ?
>
> enum simple_util_sysclk_order {
> SIMPLE_SYSCLK_ORDER_CODEC_FIRST = 0,
> SIMPLE_SYSCLK_ORDER_CPU_FIRST,
> };
>
> Do you set this "order" via custome driver if you want ot use CPU_FIRST ?

Or, not use flag, but check whether "clock master" ?

Thank you for your help !!

Best regards
---
Kuninori Morimoto