Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Stefano Radaelli <stefano.radaelli21@gmail.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	alexander.h@variscite.com, pierluigi.p@variscite.com,
	Stefano Radaelli <stefano.r@variscite.com>
Subject: Re: [PATCH v3] ASoC: simple-card-utils: add sysclk ordering support
Date: Thu, 12 Feb 2026 10:20:03 +0100	[thread overview]
Message-ID: <aY2bQ0_bKBqvSFsB@Lord-Beerus.station> (raw)
In-Reply-To: <87o6luu00l.wl-kuninori.morimoto.gx@renesas.com>

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

  reply	other threads:[~2026-02-12  9:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 11:28 [PATCH v3] ASoC: simple-card-utils: add sysclk ordering support Stefano Radaelli
2026-02-12  0:31 ` Kuninori Morimoto
2026-02-12  3:13   ` Kuninori Morimoto
2026-02-12  9:20     ` Stefano Radaelli [this message]
2026-02-12 22:34       ` Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aY2bQ0_bKBqvSFsB@Lord-Beerus.station \
    --to=stefano.radaelli21@gmail.com \
    --cc=alexander.h@variscite.com \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pierluigi.p@variscite.com \
    --cc=stefano.r@variscite.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox