drivers: audio: dmic_mcux: init active_buf_idx when setting up dma
In case the dmic had previous been run and stopped,
make sure active_buf_idx is initialized to 0 when
setting up dma on start, otherwise the dma callback
can return the wrong buffer.
Also purge the rx_queue before freeing the slab buffers,
to minimize risk of any async read request getting
back a slab buffer that is freed.
Signed-off-by:
Mike J. Chen <mjchen@google.com>
Loading
Please sign in to comment