[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aFJ76BA1aTtBMn31@opensource.cirrus.com>
Date: Wed, 18 Jun 2025 09:42:16 +0100
From: Charles Keepax <ckeepax@...nsource.cirrus.com>
To: Shengjiu Wang <shengjiu.wang@...il.com>
Cc: Shengjiu Wang <shengjiu.wang@....com>, lgirdwood@...il.com,
broonie@...nel.org, perex@...ex.cz, tiwai@...e.com,
patches@...nsource.cirrus.com, linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] ASoC: wm8524: enable constraints when sysclk is
configured.
On Wed, Jun 18, 2025 at 03:45:48PM +0800, Shengjiu Wang wrote:
> On Tue, Jun 17, 2025 at 4:55 PM Charles Keepax
> <ckeepax@...nsource.cirrus.com> wrote:
> > On Tue, Jun 17, 2025 at 03:18:33PM +0800, Shengjiu Wang wrote:
> > > In some cases, the sysclk won't be configured on init, and sysclk can be
> > > changed in hw_params() according to different sample rate, for example,
> > > for 44kHz sample rate, the sysclk is 11.2896MHz, for 48kHz sample rate,
> > > the sysclk is 12.288MHz.
> > >
> > > In order to support the above case, only enable constraints when sysclk
> > > is configured.
> > >
> > > Signed-off-by: Shengjiu Wang <shengjiu.wang@....com>
> > > ---
> > > @@ -98,6 +93,8 @@ static int wm8524_set_dai_sysclk(struct snd_soc_dai *codec_dai,
> > > int i, j = 0;
> > >
> > > wm8524->sysclk = freq;
> > > + if (!wm8524->sysclk)
> > > + return 0;
> > >
> > > wm8524->rate_constraint.count = 0;
> > > for (i = 0; i < ARRAY_SIZE(lrclk_ratios); i++) {
> >
> > We probably should clear rate_constraint.count in the clearing
> > sysclk case, and we should probably also check if the DAI is
> > active. The user shoudln't be allowed to change clock there is
> > audio already happening.
>
> Seems we can't check if the DAI is active or not in sysclk(),
> because startup()->set_sysclk(), in sysclk() the dai is always
> active. if we allow the clock changed in hw_params time, then
> we can't check if the DAI is active.
Yeah seems you are correct there, feel free to ignore this
comment. Looking in more detail as there is only a single, single
direction DAI, I think there is less concern here as well as we
can't really open the hardware for two rates at once anyway.
Thanks,
Charles
Powered by blists - more mailing lists