aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryitian <yitian.bu@tangramtek.com>2015-09-29 10:43:17 -0400
committerMark Brown <broonie@kernel.org>2015-10-02 13:05:51 -0400
commit924eb475126fd6bc23c475ac742a69fc466c0b75 (patch)
treece3a86099de66c43cb195a10e13fa715f450e675
parent4873867e5f2bd90faad861dd94865099fc3140f3 (diff)
ASoC: dwc: fix dma stop transferring issue
Designware I2S uses tx empty and rx available signals as the DMA handshaking signals. during music playing, if XRUN occurs, i2s_stop() function will be executed and both tx and rx irq are masked, when music continues to be played, i2s_start() is executed but both tx and rx irq are not unmasked which cause I2S stop sending DMA handshaking signal to DMA controller, and it finally causes music playing will be stopped once XRUN occurs for the first time. [On list discussion suggests this may be partly a race condition on slow systems -- broonie] Signed-off-by: Yitian Bu <yitian.bu@tangramtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/dwc/designware_i2s.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index 0d28e3b356f6..ba34252b7bba 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -141,13 +141,22 @@ static inline void i2s_clear_irqs(struct dw_i2s_dev *dev, u32 stream)
141static void i2s_start(struct dw_i2s_dev *dev, 141static void i2s_start(struct dw_i2s_dev *dev,
142 struct snd_pcm_substream *substream) 142 struct snd_pcm_substream *substream)
143{ 143{
144 144 u32 i, irq;
145 i2s_write_reg(dev->i2s_base, IER, 1); 145 i2s_write_reg(dev->i2s_base, IER, 1);
146 146
147 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 147 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
148 for (i = 0; i < 4; i++) {
149 irq = i2s_read_reg(dev->i2s_base, IMR(i));
150 i2s_write_reg(dev->i2s_base, IMR(i), irq & ~0x30);
151 }
148 i2s_write_reg(dev->i2s_base, ITER, 1); 152 i2s_write_reg(dev->i2s_base, ITER, 1);
149 else 153 } else {
154 for (i = 0; i < 4; i++) {
155 irq = i2s_read_reg(dev->i2s_base, IMR(i));
156 i2s_write_reg(dev->i2s_base, IMR(i), irq & ~0x03);
157 }
150 i2s_write_reg(dev->i2s_base, IRER, 1); 158 i2s_write_reg(dev->i2s_base, IRER, 1);
159 }
151 160
152 i2s_write_reg(dev->i2s_base, CER, 1); 161 i2s_write_reg(dev->i2s_base, CER, 1);
153} 162}