alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: pcm512x: Mend accesses to the I2S_1 and I2S_2 registers
@ 2021-09-20 14:49 Peter Rosin
  2021-09-20 18:37 ` Péter Ujfalusi
  2021-09-21 15:25 ` Mark Brown
  0 siblings, 2 replies; 14+ messages in thread
From: Peter Rosin @ 2021-09-20 14:49 UTC (permalink / raw)
  To: alsa-devel
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Liam Girdwood,
	Peter Ujfalusi, Kirill Marinushkin, Mark Brown

From 625f858894af2b7e547cc723b97361081438b123 Mon Sep 17 00:00:00 2001
From: Peter Rosin <peda@axentia.se>

Commit 25d27c4f68d2 ("ASoC: pcm512x: Add support for more data formats")
breaks the TSE-850 device, which is using a pcm5142 in I2S and
CBM_CFS mode (maybe not relevant). Without this fix, the result
is:

pcm512x 0-004c: Failed to set data format: -16

And after that, no sound.

This fix is not 100% correct. The datasheet of at least the pcm5142
states that four bits (0xcc) in the I2S_1 register are "RSV"
("Reserved. Do not access.") and no hint is given as to what the
initial values are supposed to be. So, specifying defaults for
these bits is wrong. But perhaps better than a broken driver?

Fixes: 25d27c4f68d2 ("ASoC: pcm512x: Add support for more data formats")
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Kirill Marinushkin <kmarinushkin@birdec.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Peter Rosin <peda@axentia.se>
---
 sound/soc/codecs/pcm512x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
index 4dc844f3c1fc..60dee41816dc 100644
--- a/sound/soc/codecs/pcm512x.c
+++ b/sound/soc/codecs/pcm512x.c
@@ -116,6 +116,8 @@ static const struct reg_default pcm512x_reg_defaults[] = {
 	{ PCM512x_FS_SPEED_MODE,     0x00 },
 	{ PCM512x_IDAC_1,            0x01 },
 	{ PCM512x_IDAC_2,            0x00 },
+	{ PCM512x_I2S_1,             0x02 },
+	{ PCM512x_I2S_2,             0x00 },
 };
 
 static bool pcm512x_readable(struct device *dev, unsigned int reg)
-- 
2.20.1


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

end of thread, other threads:[~2021-09-21 17:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-20 14:49 [PATCH] ASoC: pcm512x: Mend accesses to the I2S_1 and I2S_2 registers Peter Rosin
2021-09-20 18:37 ` Péter Ujfalusi
2021-09-20 19:37   ` Peter Rosin
2021-09-20 21:29     ` Mark Brown
2021-09-21  6:37       ` Peter Rosin
2021-09-21 11:11         ` Mark Brown
2021-09-21  4:20     ` Péter Ujfalusi
2021-09-21  6:52       ` Peter Rosin
2021-09-21  8:10         ` Peter Rosin
2021-09-21  8:48           ` Peter Rosin
2021-09-21 12:01             ` Mark Brown
2021-09-21 13:30               ` Peter Rosin
2021-09-21 17:22                 ` Péter Ujfalusi
2021-09-21 15:25 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).