mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
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>
This commit is contained in:
parent
92e2a6f682
commit
539d3d8cbe
1 changed files with 18 additions and 18 deletions
|
@ -378,17 +378,17 @@ static void mcasp_start_tx(struct davinci_audio_dev *dev)
|
|||
|
||||
static void davinci_mcasp_start(struct davinci_audio_dev *dev, int stream)
|
||||
{
|
||||
if (stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
if (dev->txnumevt) /* enable FIFO */
|
||||
mcasp_set_bits(dev->base + DAVINCI_MCASP_WFIFOCTL,
|
||||
FIFO_ENABLE);
|
||||
mcasp_start_tx(dev);
|
||||
else
|
||||
} else {
|
||||
if (dev->rxnumevt) /* enable FIFO */
|
||||
mcasp_set_bits(dev->base + DAVINCI_MCASP_RFIFOCTL,
|
||||
FIFO_ENABLE);
|
||||
mcasp_start_rx(dev);
|
||||
|
||||
/* enable FIFO */
|
||||
if (dev->txnumevt)
|
||||
mcasp_set_bits(dev->base + DAVINCI_MCASP_WFIFOCTL, FIFO_ENABLE);
|
||||
|
||||
if (dev->rxnumevt)
|
||||
mcasp_set_bits(dev->base + DAVINCI_MCASP_RFIFOCTL, FIFO_ENABLE);
|
||||
}
|
||||
}
|
||||
|
||||
static void mcasp_stop_rx(struct davinci_audio_dev *dev)
|
||||
|
@ -405,17 +405,17 @@ static void mcasp_stop_tx(struct davinci_audio_dev *dev)
|
|||
|
||||
static void davinci_mcasp_stop(struct davinci_audio_dev *dev, int stream)
|
||||
{
|
||||
if (stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
if (dev->txnumevt) /* disable FIFO */
|
||||
mcasp_clr_bits(dev->base + DAVINCI_MCASP_WFIFOCTL,
|
||||
FIFO_ENABLE);
|
||||
mcasp_stop_tx(dev);
|
||||
else
|
||||
} else {
|
||||
if (dev->rxnumevt) /* disable FIFO */
|
||||
mcasp_clr_bits(dev->base + DAVINCI_MCASP_RFIFOCTL,
|
||||
FIFO_ENABLE);
|
||||
mcasp_stop_rx(dev);
|
||||
|
||||
/* disable FIFO */
|
||||
if (dev->txnumevt)
|
||||
mcasp_clr_bits(dev->base + DAVINCI_MCASP_WFIFOCTL, FIFO_ENABLE);
|
||||
|
||||
if (dev->rxnumevt)
|
||||
mcasp_clr_bits(dev->base + DAVINCI_MCASP_RFIFOCTL, FIFO_ENABLE);
|
||||
}
|
||||
}
|
||||
|
||||
static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
|
||||
|
|
Loading…
Reference in a new issue