aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Jackson <Andrew.Jackson@arm.com>2014-10-03 09:29:01 +0100
committerJon Medhurst <tixy@linaro.org>2015-06-30 10:12:59 +0100
commitd3072fa863cef08e37eea5524f1e7fe41d6ec5e1 (patch)
treed21e18ff59d657e58cca7c47cefbc6a86d8ef199
parent820493db4ec4a175dd92b3184c1d07d666e96274 (diff)
ASoC: dwc: Ensure FIFOs are flushed to prevent channel swap
If the FIFOs aren't flushed, the left/right channels may be swapped: this may occur if the FIFOs are not empty when the streams start. Signed-off-by: Andrew Jackson <Andrew.Jackson@arm.com> Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r--sound/soc/dwc/designware_i2s.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index 0923b79c093f..e9a7667ea49a 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -259,6 +259,7 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream,
*/
do {
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ i2s_write_reg(dev->i2s_base, TXFFR, 1);
i2s_write_reg(dev->i2s_base, TCR(ch_reg),
xfer_resolution);
i2s_write_reg(dev->i2s_base, TFCR(ch_reg), 0x02);
@@ -266,6 +267,7 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream,
i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x30);
i2s_write_reg(dev->i2s_base, TER(ch_reg), 1);
} else {
+ i2s_write_reg(dev->i2s_base, RXFFR, 1);
i2s_write_reg(dev->i2s_base, RCR(ch_reg),
xfer_resolution);
i2s_write_reg(dev->i2s_base, RFCR(ch_reg), 0x07);