aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci/davinci-i2s.c
diff options
context:
space:
mode:
authorNaresh Medisetty <naresh@ti.com>2008-11-18 00:31:03 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2008-11-18 06:40:04 -0500
commitcb6e2063697e91ca6983f9fe6958d20469b43641 (patch)
tree65d2fdaeb8550a67fc5284a26092a7da2e34612c /sound/soc/davinci/davinci-i2s.c
parent8d702f2376d25ab277c38b57015f4aa990bc7f16 (diff)
ASoC: DaVinci: Fix audio stall when doing full duplex
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> Signed-off-by: Naresh Medisetty <naresh@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/davinci/davinci-i2s.c')
-rw-r--r--sound/soc/davinci/davinci-i2s.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
index 8c1bf876031d..11c20d0b7bcc 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,
295 u32 w; 295 u32 w;
296 296
297 /* general line settings */ 297 /* general line settings */
298 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, 298 w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
299 DAVINCI_MCBSP_SPCR_RINTM(3) | 299 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
300 DAVINCI_MCBSP_SPCR_XINTM(3) | 300 w |= DAVINCI_MCBSP_SPCR_RINTM(3) | DAVINCI_MCBSP_SPCR_FREE;
301 DAVINCI_MCBSP_SPCR_FREE); 301 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w);
302 } else {
303 w |= DAVINCI_MCBSP_SPCR_XINTM(3) | DAVINCI_MCBSP_SPCR_FREE;
304 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w);
305 }
302 306
303 i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS); 307 i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS);
304 w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SRGR_REG); 308 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,
329 return -EINVAL; 333 return -EINVAL;
330 } 334 }
331 335
332 w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_RCR_REG); 336 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
333 MOD_REG_BIT(w, DAVINCI_MCBSP_RCR_RWDLEN1(mcbsp_word_length) | 337 w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_RCR_REG);
334 DAVINCI_MCBSP_RCR_RWDLEN2(mcbsp_word_length), 1); 338 MOD_REG_BIT(w, DAVINCI_MCBSP_RCR_RWDLEN1(mcbsp_word_length) |
335 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, w); 339 DAVINCI_MCBSP_RCR_RWDLEN2(mcbsp_word_length), 1);
340 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, w);
336 341
337 w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_XCR_REG); 342 } else {
338 MOD_REG_BIT(w, DAVINCI_MCBSP_XCR_XWDLEN1(mcbsp_word_length) | 343 w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_XCR_REG);
339 DAVINCI_MCBSP_XCR_XWDLEN2(mcbsp_word_length), 1); 344 MOD_REG_BIT(w, DAVINCI_MCBSP_XCR_XWDLEN1(mcbsp_word_length) |
340 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, w); 345 DAVINCI_MCBSP_XCR_XWDLEN2(mcbsp_word_length), 1);
346 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, w);
341 347
348 }
342 return 0; 349 return 0;
343} 350}
344 351