Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b56bff43 authored by oder_chiou@realtek.com's avatar oder_chiou@realtek.com Committed by Mark Brown
Browse files

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: default avatarHsin-Yu Chao <hychao@chromium.org>
Signed-off-by: default avatarOder Chiou <oder_chiou@realtek.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 818010da
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -151,7 +151,6 @@ static irqreturn_t rt5514_spi_irq(int irq, void *data)
	u8 buf[8];
	u8 buf[8];


	rt5514_dsp->get_size = 0;
	rt5514_dsp->get_size = 0;
	rt5514_dsp->dma_offset = 0;


	/**
	/**
	 * The address area x1800XXXX is the register address, and it cannot
	 * 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,
	ret = snd_pcm_lib_alloc_vmalloc_buffer(substream,
	ret = snd_pcm_lib_alloc_vmalloc_buffer(substream,
			params_buffer_bytes(hw_params));
			params_buffer_bytes(hw_params));
	rt5514_dsp->substream = substream;
	rt5514_dsp->substream = substream;
	rt5514_dsp->dma_offset = 0;
	mutex_unlock(&rt5514_dsp->dma_lock);
	mutex_unlock(&rt5514_dsp->dma_lock);


	return ret;
	return ret;