Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
To: alsa-devel@alsa-project.org
Cc: broonie@opensource.wolfsonmicro.com
Subject: [PATCH 1/2] ASoC: tlv320dac33: BCLK divider fix
Date: Wed, 20 Jan 2010 09:39:35 +0200	[thread overview]
Message-ID: <1263973176-15925-2-git-send-email-peter.ujfalusi@nokia.com> (raw)
In-Reply-To: <1263973176-15925-1-git-send-email-peter.ujfalusi@nokia.com>

The BCLK divider was not configured in case of mode7.
This leads to unpredictable behavior when switching between FIFO modes.
Configure the BCLK divider depending on the fifo_mode (FIFO is in use,
or FIFO bypass).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
---
 sound/soc/codecs/tlv320dac33.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index 65683aa..e1aa66f 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -845,11 +845,14 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream)
 	dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_A, aictrl_a);
 	dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_B, aictrl_b);
 
-	switch (dac33->fifo_mode) {
-	case DAC33_FIFO_MODE1:
-		/* 20: BCLK divide ratio */
+	/* BCLK divide ratio */
+	if (dac33->fifo_mode)
 		dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_C, 3);
+	else
+		dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_C, 32);
 
+	switch (dac33->fifo_mode) {
+	case DAC33_FIFO_MODE1:
 		dac33_write16(codec, DAC33_ATHR_MSB,
 			      DAC33_THRREG(dac33->alarm_threshold));
 		break;
@@ -864,8 +867,6 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream)
 			DAC33_THRREG(10));
 		break;
 	default:
-		/* BYPASS mode */
-		dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_C, 32);
 		break;
 	}
 
-- 
1.6.6

  reply	other threads:[~2010-01-20  7:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20  7:39 [PATCH 0/2] ASoC: tlv320dac33: Burst mode BCLK divider fixes Peter Ujfalusi
2010-01-20  7:39 ` Peter Ujfalusi [this message]
2010-01-20  7:39   ` [PATCH 2/2] ASoC: tlv320dac33: Burst mode BCLK divider configuration Peter Ujfalusi
2010-01-20 11:35 ` [PATCH 0/2] ASoC: tlv320dac33: Burst mode BCLK divider fixes Liam Girdwood
2010-01-20 11:48 ` Mark Brown

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=1263973176-15925-2-git-send-email-peter.ujfalusi@nokia.com \
    --to=peter.ujfalusi@nokia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    /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