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

Commit 43044024 authored by Banajit Goswami's avatar Banajit Goswami
Browse files

ASoC: msm: qdsp6v2: requeue read buffers in mmap device switch



When device switch happens, ASM might return a 0 length
buffer. For MMAP style capture cases, buffers need to be
re-queued at the event handler for this case, otherwise
ASM will have no buffers to read data into after the
device is over successful.

CRs-fixed: 700614
Change-Id: I2b8930a3058bbe3979405d5de04d3371291db42d
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
parent 386bd91c
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -205,7 +205,16 @@ static void event_handler(uint32_t opcode,
			pr_debug("%s: reclaim flushed buf in_count %x\n",
				__func__, atomic_read(&prtd->in_count));
			prtd->pcm_irq_pos += prtd->pcm_count;
			if (prtd->mmap_flag) {
				if (q6asm_is_cpu_buf_avail_nolock(OUT,
				    prtd->audio_client,
				    &size, &idx) &&
				    (substream->runtime->status->state ==
				    SNDRV_PCM_STATE_RUNNING))
					q6asm_read_nolock(prtd->audio_client);
			} else {
				atomic_inc(&prtd->in_count);
			}
			if (atomic_read(&prtd->in_count) == prtd->periods) {
				pr_info("%s: reclaimed all bufs\n", __func__);
				if (atomic_read(&prtd->start))