From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Sune Brian <briansune@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sound/soc/codecs/wm8978: add missing BCLK divider setup
Date: Tue, 7 Oct 2025 13:11:24 +0100 [thread overview]
Message-ID: <aOUDbF/i4+9PXc1j@opensource.cirrus.com> (raw)
In-Reply-To: <CAN7C2SB5Re35yGYsqr14hGXde3nTKLX2Aa3ZbuJ9xuT0m07uxg@mail.gmail.com>
On Tue, Oct 07, 2025 at 07:22:10PM +0800, Sune Brian wrote:
> Charles Keepax <ckeepax@opensource.cirrus.com> 於 2025年10月7日 週二 下午6:30寫道:
> > On Fri, Oct 03, 2025 at 05:13:04PM +0800, Brian Sune wrote:
> > > The original WM8978 codec driver did not set the BCLK (bit clock)
> > > divider, which can cause audio clocks to be incorrect or unstable
> > > depending on the sample rate and word length.
> >
> > This isn't totally accurate, the driver expects it will be set
> > through the set_clkdiv callback. Which one could probably argue
> > is a bit of a more legacy approach, but probably worth calling
> > that out here.
>
> According to actual hardware tests and the WM8978 driver study.
> There are no bclk register setup in the entire driver. So I am not sure
> How could this even set through the callback? The IC itself requires
> 2-wires register load and this can't be done via software level.
/*
* Configure WM8978 clock dividers.
*/
static int wm8978_set_dai_clkdiv(struct snd_soc_dai *codec_dai,
int div_id, int div)
{
struct snd_soc_component *component = codec_dai->component;
struct wm8978_priv *wm8978 = snd_soc_component_get_drvdata(component);
int ret = 0;
switch (div_id) {
case WM8978_OPCLKRATE:
...
case WM8978_BCLKDIV:
if (div & ~0x1c)
return -EINVAL;
snd_soc_component_update_bits(component, WM8978_CLOCKING, 0x1c, div); <<---- HERE
break;
default:
return -EINVAL;
}
dev_dbg(component->dev, "%s: ID %d, value %u\n", __func__, div_id, div);
return ret;
}
Its not missing its right there. That said your way is probably
slightly more standard these days, but we should take care of the
interaction between the two.
Thanks,
Charles
next prev parent reply other threads:[~2025-10-07 12:11 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-03 9:13 [PATCH] sound/soc/codecs/wm8978: add missing BCLK divider setup Brian Sune
2025-10-07 10:30 ` Charles Keepax
2025-10-07 11:22 ` Sune Brian
2025-10-07 12:11 ` Charles Keepax [this message]
2025-10-07 12:18 ` Mark Brown
2025-10-07 12:26 ` Charles Keepax
2025-10-07 12:30 ` Mark Brown
2025-10-07 12:37 ` Sune Brian
2025-10-07 12:48 ` Sune Brian
2025-10-07 13:15 ` Charles Keepax
2025-10-07 13:39 ` Sune Brian
2025-10-07 13:48 ` Mark Brown
2025-10-07 13:54 ` Sune Brian
2025-10-07 11:33 ` [PATCH v2] ASoC: wm8978: " Brian Sune
2025-10-07 11:44 ` Mark Brown
2025-10-07 11:48 ` Sune Brian
2025-10-07 11:52 ` Mark Brown
2025-10-07 11:56 ` Sune Brian
2025-10-07 12:10 ` Mark Brown
2025-10-07 13:03 ` Sune Brian
2025-10-07 13:15 ` Mark Brown
2025-10-07 13:48 ` Sune Brian
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=aOUDbF/i4+9PXc1j@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=briansune@gmail.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 \
/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