Commit 7ece50c9 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branch 'asoc/for-4.19' into asoc-4.20

parents e3a360b8 747df197
...@@ -1040,16 +1040,22 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream) ...@@ -1040,16 +1040,22 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream)
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
period_bytes = frames_to_bytes(runtime, runtime->period_size); period_bytes = frames_to_bytes(runtime, runtime->period_size);
dscr = acp_reg_read(rtd->acp_mmio, rtd->dma_curr_dscr);
if (dscr == rtd->dma_dscr_idx_1)
pos = period_bytes;
else
pos = 0;
bytescount = acp_get_byte_count(rtd); bytescount = acp_get_byte_count(rtd);
if (bytescount > rtd->bytescount) if (bytescount >= rtd->bytescount)
bytescount -= rtd->bytescount; bytescount -= rtd->bytescount;
delay = do_div(bytescount, period_bytes); if (bytescount < period_bytes) {
runtime->delay = bytes_to_frames(runtime, delay); pos = 0;
} else {
dscr = acp_reg_read(rtd->acp_mmio, rtd->dma_curr_dscr);
if (dscr == rtd->dma_dscr_idx_1)
pos = period_bytes;
else
pos = 0;
}
if (bytescount > 0) {
delay = do_div(bytescount, period_bytes);
runtime->delay = bytes_to_frames(runtime, delay);
}
} else { } else {
buffersize = frames_to_bytes(runtime, runtime->buffer_size); buffersize = frames_to_bytes(runtime, runtime->buffer_size);
bytescount = acp_get_byte_count(rtd); bytescount = acp_get_byte_count(rtd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment