All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Rhodes <bgr@acdstar.com>
To: alsa-devel@alsa-project.org
Subject: ASoC: pxa2xx-i2s
Date: Tue, 20 Jan 2009 08:31:12 -0600	[thread overview]
Message-ID: <4975E030.5080905@acdstar.com> (raw)

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

i2s replay is not being enabled properly on occasion on my pxa270 
board.  Current code is touching SACR1 in hw_params which I believe is 
not correct.  That should be configured in trigger before enabling i2s.  
Record is not disabled for playback mode.  Any invalid data in the 
transmit fifo causes deadlock and replay is being disabled.

I have been able to reproduce it in kernel 2.6.26 as well as Linus' git 
tree using speaker-test.  (repeatedly starting and stopping).  I've 
verified that this fix prevents (at least) this condition.

Please review this patch and let me know if there is anything I have 
overlooked.

Thanks

[-- Attachment #2: pxa2xx-i2s-clean-startup.patch --]
[-- Type: text/plain, Size: 906 bytes --]

diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index 517991f..6cda7f1 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -211,12 +211,10 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
 	if (!(SACR0 & SACR0_ENB)) {
 
 		SACR0 = 0;
-		SACR1 = 0;
 		if (pxa_i2s.master)
 			SACR0 |= SACR0_BCKD;
 
 		SACR0 |= SACR0_RFTH(14) | SACR0_TFTH(1);
-		SACR1 |= pxa_i2s.fmt;
 	}
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
 		SAIMR |= SAIMR_TFS;
@@ -257,6 +255,12 @@ static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
 
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_START:
+		SACR1 = pxa_i2s.fmt | SACR1_DRPL | SACR1_DREC;
+		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+			SACR1 &= ~SACR1_DRPL;
+		} else {
+			SACR1 &= ~SACR1_DREC;
+		}
 		SACR0 |= SACR0_ENB;
 		break;
 	case SNDRV_PCM_TRIGGER_RESUME:

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

             reply	other threads:[~2009-01-20 14:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-20 14:31 Brian Rhodes [this message]
2009-01-20 15:44 ` ASoC: pxa2xx-i2s Karl Beldan
2009-01-20 17:04   ` Brian Rhodes
2009-01-20 22:24     ` Brian Rhodes
2009-01-21 13:23       ` Mark Brown
     [not found]         ` <49775159.7070708@linespeed.net>
2009-01-21 19:32           ` Mark Brown
2009-01-21 20:13             ` Brian Rhodes
2009-01-21 22:27               ` Mark Brown
2009-01-22 17:03                 ` Brian Rhodes
2009-01-23 16:50                 ` Brian Rhodes
2009-01-23 16:58                   ` Mark Brown
2009-05-08 22:13                   ` Karl Beldan

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=4975E030.5080905@acdstar.com \
    --to=bgr@acdstar.com \
    --cc=alsa-devel@alsa-project.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 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.