aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroder_chiou@realtek.com <oder_chiou@realtek.com>2017-08-07 06:39:32 -0400
committerMark Brown <broonie@kernel.org>2017-08-07 07:32:31 -0400
commitb56bff43a965ffe03b4a994fd1a102059d272807 (patch)
tree18072f5b5da56f8e04f44bc148b03a2d116b81c0
parent818010dac09183e99ff02e35836544b2e1d659f3 (diff)
ASoC: rt5514: reset dma_offset at hw_params
dma_offset needs reset every time otherwise for consecutive PCM open the last dma_offset value will cause incorrect pointer position be reported to user space. Signed-off-by: Hsin-Yu Chao <hychao@chromium.org> Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/rt5514-spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c
index 6f513cc4c56c..640193d845be 100644
--- a/sound/soc/codecs/rt5514-spi.c
+++ b/sound/soc/codecs/rt5514-spi.c
@@ -151,7 +151,6 @@ static irqreturn_t rt5514_spi_irq(int irq, void *data)
151 u8 buf[8]; 151 u8 buf[8];
152 152
153 rt5514_dsp->get_size = 0; 153 rt5514_dsp->get_size = 0;
154 rt5514_dsp->dma_offset = 0;
155 154
156 /** 155 /**
157 * The address area x1800XXXX is the register address, and it cannot 156 * The address area x1800XXXX is the register address, and it cannot
@@ -205,6 +204,7 @@ static int rt5514_spi_hw_params(struct snd_pcm_substream *substream,
205 ret = snd_pcm_lib_alloc_vmalloc_buffer(substream, 204 ret = snd_pcm_lib_alloc_vmalloc_buffer(substream,
206 params_buffer_bytes(hw_params)); 205 params_buffer_bytes(hw_params));
207 rt5514_dsp->substream = substream; 206 rt5514_dsp->substream = substream;
207 rt5514_dsp->dma_offset = 0;
208 mutex_unlock(&rt5514_dsp->dma_lock); 208 mutex_unlock(&rt5514_dsp->dma_lock);
209 209
210 return ret; 210 return ret;