aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci
diff options
context:
space:
mode:
authorChaithrika U S <chaithrika@ti.com>2009-09-23 10:12:08 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-09-23 13:37:08 -0400
commit539d3d8cbe5cf7597d4c4c4428aec242f9ea5185 (patch)
tree503d1415bf4874484b4bc08633266a7f203b9e54 /sound/soc/davinci
parent92e2a6f68219f8d4c862b1f29c653b05639e4c06 (diff)
ASoC: DaVinci: Correct McASP FIFO initialization
McASP write FIFO registers should be modified for playback and read FIFO registers for capture. Check the PCM mode before manipulating the FIFO registers. Currently, irrespective of playback/capture both the FIFOs are enabled or disbaled. This resulted in errors in audio loopback mode. Signed-off-by: Chaithrika U S <chaithrika@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/davinci')
-rw-r--r--sound/soc/davinci/davinci-mcasp.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 3174d96d929f..5d1f98a4c978 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -378,17 +378,17 @@ static void mcasp_start_tx(struct davinci_audio_dev *dev)
378 378
379static void davinci_mcasp_start(struct davinci_audio_dev *dev, int stream) 379static void davinci_mcasp_start(struct davinci_audio_dev *dev, int stream)
380{ 380{
381 if (stream == SNDRV_PCM_STREAM_PLAYBACK) 381 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
382 if (dev->txnumevt) /* enable FIFO */
383 mcasp_set_bits(dev->base + DAVINCI_MCASP_WFIFOCTL,
384 FIFO_ENABLE);
382 mcasp_start_tx(dev); 385 mcasp_start_tx(dev);
383 else 386 } else {
387 if (dev->rxnumevt) /* enable FIFO */
388 mcasp_set_bits(dev->base + DAVINCI_MCASP_RFIFOCTL,
389 FIFO_ENABLE);
384 mcasp_start_rx(dev); 390 mcasp_start_rx(dev);
385 391 }
386 /* enable FIFO */
387 if (dev->txnumevt)
388 mcasp_set_bits(dev->base + DAVINCI_MCASP_WFIFOCTL, FIFO_ENABLE);
389
390 if (dev->rxnumevt)
391 mcasp_set_bits(dev->base + DAVINCI_MCASP_RFIFOCTL, FIFO_ENABLE);
392} 392}
393 393
394static void mcasp_stop_rx(struct davinci_audio_dev *dev) 394static void mcasp_stop_rx(struct davinci_audio_dev *dev)
@@ -405,17 +405,17 @@ static void mcasp_stop_tx(struct davinci_audio_dev *dev)
405 405
406static void davinci_mcasp_stop(struct davinci_audio_dev *dev, int stream) 406static void davinci_mcasp_stop(struct davinci_audio_dev *dev, int stream)
407{ 407{
408 if (stream == SNDRV_PCM_STREAM_PLAYBACK) 408 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
409 if (dev->txnumevt) /* disable FIFO */
410 mcasp_clr_bits(dev->base + DAVINCI_MCASP_WFIFOCTL,
411 FIFO_ENABLE);
409 mcasp_stop_tx(dev); 412 mcasp_stop_tx(dev);
410 else 413 } else {
414 if (dev->rxnumevt) /* disable FIFO */
415 mcasp_clr_bits(dev->base + DAVINCI_MCASP_RFIFOCTL,
416 FIFO_ENABLE);
411 mcasp_stop_rx(dev); 417 mcasp_stop_rx(dev);
412 418 }
413 /* disable FIFO */
414 if (dev->txnumevt)
415 mcasp_clr_bits(dev->base + DAVINCI_MCASP_WFIFOCTL, FIFO_ENABLE);
416
417 if (dev->rxnumevt)
418 mcasp_clr_bits(dev->base + DAVINCI_MCASP_RFIFOCTL, FIFO_ENABLE);
419} 419}
420 420
421static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, 421static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai,