mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RESEND PATCH] ASoC: wm8960: Fix clock configuration on slave mode
@ 2021-10-12 10:54 Shengjiu Wang
  2021-10-12 11:25 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Shengjiu Wang @ 2021-10-12 10:54 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, ckeepax, kuninori.morimoto.gx,
	patches, alsa-devel, linux-kernel

There is a noise issue for 8kHz sample rate on slave mode.
Compared with master mode, the difference is the DACDIV
setting, after correcting the DACDIV, the noise is gone.

There is no noise issue for 48kHz sample rate, because
the default value of DACDIV is correct for 48kHz.

So wm8960_configure_clocking() should be functional for
ADC and DAC function even if it is slave mode.

In order to be compatible for old use case, just add
condition for checking that sysclk is zero with
slave mode.

Fixes: 0e50b51aa22f ("ASoC: wm8960: Let wm8960 driver configure its bit clock and frame clock")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/codecs/wm8960.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index 9e621a254392..9c6af76a60fd 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -742,7 +742,7 @@ static int wm8960_configure_clocking(struct snd_soc_component *component)
 	int i, j, k;
 	int ret;
 
-	if (!(iface1 & (1<<6))) {
+	if (!(iface1 & (1 << 6)) && !wm8960->sysclk) {
 		dev_dbg(component->dev,
 			"Codec is slave mode, no need to configure clock\n");
 		return 0;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RESEND PATCH] ASoC: wm8960: Fix clock configuration on slave mode
  2021-10-12 10:54 [RESEND PATCH] ASoC: wm8960: Fix clock configuration on slave mode Shengjiu Wang
@ 2021-10-12 11:25 ` Mark Brown
  2021-10-13  3:10   ` Shengjiu Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2021-10-12 11:25 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: lgirdwood, perex, tiwai, ckeepax, kuninori.morimoto.gx, patches,
	alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 362 bytes --]

On Tue, Oct 12, 2021 at 06:54:30PM +0800, Shengjiu Wang wrote:
> There is a noise issue for 8kHz sample rate on slave mode.
> Compared with master mode, the difference is the DACDIV
> setting, after correcting the DACDIV, the noise is gone.

Charles suggested some updates to the patch to improve the error
reporting here which you don't seem to have addressed.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RESEND PATCH] ASoC: wm8960: Fix clock configuration on slave mode
  2021-10-12 11:25 ` Mark Brown
@ 2021-10-13  3:10   ` Shengjiu Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Shengjiu Wang @ 2021-10-13  3:10 UTC (permalink / raw)
  To: Mark Brown
  Cc: Shengjiu Wang, alsa-devel, Charles Keepax, Kuninori Morimoto,
	patches, Takashi Iwai, Liam Girdwood, linux-kernel

On Tue, Oct 12, 2021 at 7:26 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Tue, Oct 12, 2021 at 06:54:30PM +0800, Shengjiu Wang wrote:
> > There is a noise issue for 8kHz sample rate on slave mode.
> > Compared with master mode, the difference is the DACDIV
> > setting, after correcting the DACDIV, the noise is gone.
>
> Charles suggested some updates to the patch to improve the error
> reporting here which you don't seem to have addressed.

Sorry, it seems his mail is missing from gmail. I find
it in my outlook now.  Let me check his comments.

Best regards
Wang Shengjiu

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-13  3:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12 10:54 [RESEND PATCH] ASoC: wm8960: Fix clock configuration on slave mode Shengjiu Wang
2021-10-12 11:25 ` Mark Brown
2021-10-13  3:10   ` Shengjiu Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®