Re: [PATCH v3] ASoC: simple-card-utils: add sysclk ordering support
From: Stefano Radaelli
Date: Thu Feb 12 2026 - 04:20:19 EST
Hi Kuninori,
>
> > (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" ?
>
thanks for the feedback!
Yes, my initial idea was to set CPU_FIRST from our downstream/custom
kernel (e.g. via a small local change) when needed.
Also thanks for the suggestion about checking the clock master.
I had a look at it, but unfortunately the information we can reliably
derive is about BCLK/FS (bitclock-master and frame-master).
These properties describe who provides the serial bus clocks, but they
do not imply anything about MCLK.
In my case, for example, the codec is both frame-master and bitclock-master,
yet I still need to call CPU DAI .set_sysclk() first because the CPU DAI may
finalize/adjust the actual MCLK rate (e.g. via clk_set_rate()) and the codec
may otherwise configure its internal clocking based on a non-final MCLK value.
So selecting the sysclk ordering based on BCLK/FS master would not
cover this case.
So, do you think the solution I proposed would be acceptable if I remove
SIMPLE_SYSCLK_ORDER_UNSPEC and keep only:
enum simple_util_sysclk_order {
SIMPLE_SYSCLK_ORDER_CODEC_FIRST = 0,
SIMPLE_SYSCLK_ORDER_CPU_FIRST,
};
with codec-first as the default behaviour?
Many thanks and best regards,
Stefano Radaelli