All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: wm8741: Fix setting BCLK and LRCLK polarity
@ 2017-11-02 13:23 Sergej Sawazki
  2017-11-03 11:18 ` Charles Keepax
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sergej Sawazki @ 2017-11-02 13:23 UTC (permalink / raw)
  To: broonie, lgirdwood, ckeepax; +Cc: ce3a, patches, alsa-devel, Sergej Sawazki

After checking the code and the datasheet, it seems like we are handling
the clock inversion (SND_SOC_DAIFMT_NB_IF and SND_SOC_DAIFMT_IB_IF) not
correctly.

>From the datasheet (Table 58):
R5 Format Control, BITS[5:4], [BCP:LRP]:
  (0) 00 =  normal   BCLK, normal   LRCLK
  (1) 01 =  normal   BCLK, inverted LRCLK <-- Fix this
  (2) 10 =  inverted BCLK, normal   LRCLK
  (3) 11 =  inverted BCLK, inverted LRCLK <-- Fix this

Signed-off-by: Sergej Sawazki <sergej@taudac.com>
---
 sound/soc/codecs/wm8741.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
index 3c96af0..a394dbe 100644
--- a/sound/soc/codecs/wm8741.c
+++ b/sound/soc/codecs/wm8741.c
@@ -333,13 +333,13 @@ static int wm8741_set_dai_fmt(struct snd_soc_dai *codec_dai,
 	switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
 	case SND_SOC_DAIFMT_NB_NF:
 		break;
-	case SND_SOC_DAIFMT_IB_IF:
+	case SND_SOC_DAIFMT_NB_IF:
 		iface |= 0x10;
 		break;
 	case SND_SOC_DAIFMT_IB_NF:
 		iface |= 0x20;
 		break;
-	case SND_SOC_DAIFMT_NB_IF:
+	case SND_SOC_DAIFMT_IB_IF:
 		iface |= 0x30;
 		break;
 	default:
-- 
2.7.4

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

end of thread, other threads:[~2017-11-03 18:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-02 13:23 [PATCH] ASoC: wm8741: Fix setting BCLK and LRCLK polarity Sergej Sawazki
2017-11-03 11:18 ` Charles Keepax
2017-11-03 11:45 ` Mark Brown
2017-11-03 13:05   ` Sergej Sawazki
2017-11-03 17:20     ` Mark Brown
2017-11-03 17:38       ` Sergej Sawazki
2017-11-03 18:02         ` Mark Brown
2017-11-03 18:50 ` Applied "ASoC: wm8741: Fix setting BCLK and LRCLK polarity" to the asoc tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.