All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: DaVinci: Fix audio stall when doing full duplex
@ 2008-11-18  5:31 naresh
  2008-11-18 11:36 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: naresh @ 2008-11-18  5:31 UTC (permalink / raw)
  To: alsa-devel; +Cc: davinci-linux-open-source, Steve Chen, Naresh Medisetty

From: Naresh Medisetty <naresh@ti.com>

Fix concurrent capture/playback issue.
The issue is caused by re-initialization of control registers used specifically
for capture or playback in both capture and playback operations.

Signed-off-by: Steve Chen <schen@mvista.com>
	       Naresh Medisetty <naresh@ti.com>
---
 sound/soc/davinci/davinci-i2s.c |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
index 8c1bf87..11c20d0 100644
--- a/sound/soc/davinci/davinci-i2s.c
+++ b/sound/soc/davinci/davinci-i2s.c
@@ -295,10 +295,14 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream,
 	u32 w;
 
 	/* general line settings */
-	davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG,
-				DAVINCI_MCBSP_SPCR_RINTM(3) |
-				DAVINCI_MCBSP_SPCR_XINTM(3) |
-				DAVINCI_MCBSP_SPCR_FREE);
+	w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
+	if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+		w |= DAVINCI_MCBSP_SPCR_RINTM(3) | DAVINCI_MCBSP_SPCR_FREE;
+		davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w);
+	} else {
+		w |= DAVINCI_MCBSP_SPCR_XINTM(3) | DAVINCI_MCBSP_SPCR_FREE;
+		davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w);
+	}
 
 	i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS);
 	w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SRGR_REG);
@@ -329,16 +333,19 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream,
 		return -EINVAL;
 	}
 
-	w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_RCR_REG);
-	MOD_REG_BIT(w, DAVINCI_MCBSP_RCR_RWDLEN1(mcbsp_word_length) |
-		       DAVINCI_MCBSP_RCR_RWDLEN2(mcbsp_word_length), 1);
-	davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, w);
+	if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+		w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_RCR_REG);
+		MOD_REG_BIT(w, DAVINCI_MCBSP_RCR_RWDLEN1(mcbsp_word_length) |
+			       DAVINCI_MCBSP_RCR_RWDLEN2(mcbsp_word_length), 1);
+		davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, w);
 
-	w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_XCR_REG);
-	MOD_REG_BIT(w, DAVINCI_MCBSP_XCR_XWDLEN1(mcbsp_word_length) |
-		       DAVINCI_MCBSP_XCR_XWDLEN2(mcbsp_word_length), 1);
-	davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, w);
+	} else {
+		w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_XCR_REG);
+		MOD_REG_BIT(w, DAVINCI_MCBSP_XCR_XWDLEN1(mcbsp_word_length) |
+			       DAVINCI_MCBSP_XCR_XWDLEN2(mcbsp_word_length), 1);
+		davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, w);
 
+	}
 	return 0;
 }
 
-- 
1.5.4.1

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

* Re: [PATCH] ASoC: DaVinci: Fix audio stall when doing full duplex
  2008-11-18  5:31 [PATCH] ASoC: DaVinci: Fix audio stall when doing full duplex naresh
@ 2008-11-18 11:36 ` Mark Brown
  2008-11-20  6:58   ` Medisetty, Naresh
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2008-11-18 11:36 UTC (permalink / raw)
  To: naresh; +Cc: alsa-devel, Steve Chen, davinci-linux-open-source

On Tue, Nov 18, 2008 at 11:01:03AM +0530, naresh@ti.com wrote:

> Fix concurrent capture/playback issue.
> The issue is caused by re-initialization of control registers used specifically
> for capture or playback in both capture and playback operations.

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

> Signed-off-by: Steve Chen <schen@mvista.com>
> 	       Naresh Medisetty <naresh@ti.com>

This should be two separate Signed-off-by: lines.

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

* Re: [PATCH] ASoC: DaVinci: Fix audio stall when doing full duplex
  2008-11-18 11:36 ` Mark Brown
@ 2008-11-20  6:58   ` Medisetty, Naresh
  0 siblings, 0 replies; 3+ messages in thread
From: Medisetty, Naresh @ 2008-11-20  6:58 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel@alsa-project.org, Steve Chen,
	davinci-linux-open-source@linux.davincidsp.com

Mark,

Thanks!

I see that you had already taken care of Signed-of-by lines for this patch.

I will take care of this in my further patches.

Regards
Naresh



________________________________________
From: Mark Brown [broonie@sirena.org.uk]
Sent: Tuesday, November 18, 2008 5:06 PM
To: Medisetty, Naresh
Cc: alsa-devel@alsa-project.org; davinci-linux-open-source@linux.davincidsp.com; Steve Chen
Subject: Re: [alsa-devel] [PATCH] ASoC: DaVinci: Fix audio stall when doing full duplex

On Tue, Nov 18, 2008 at 11:01:03AM +0530, naresh@ti.com wrote:

> Fix concurrent capture/playback issue.
> The issue is caused by re-initialization of control registers used specifically
> for capture or playback in both capture and playback operations.

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

> Signed-off-by: Steve Chen <schen@mvista.com>
>              Naresh Medisetty <naresh@ti.com>

This should be two separate Signed-off-by: lines.

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

end of thread, other threads:[~2008-11-20  7:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-18  5:31 [PATCH] ASoC: DaVinci: Fix audio stall when doing full duplex naresh
2008-11-18 11:36 ` Mark Brown
2008-11-20  6:58   ` Medisetty, Naresh

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.