提交 b0a2712f 编写于 作者: J John Bonesio 提交者: Mark Brown

ASoC: MPC5200: Support for buffer wrap around

The code in psc_dma_bcom_enqueue_tx() didn't account for the fact that
s->runtime->control->appl_ptr can wrap around to the beginning of the
buffer. This change fixes this problem.
Signed-off-by: NJohn Bonesio <bones@secretlab.ca>
Acked-by: NGrant Likely <grant.likely@secretlab.ca>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 4bc4c9a5
......@@ -69,6 +69,23 @@ static void psc_dma_bcom_enqueue_next_buffer(struct psc_dma_stream *s)
static void psc_dma_bcom_enqueue_tx(struct psc_dma_stream *s)
{
if (s->appl_ptr > s->runtime->control->appl_ptr) {
/*
* In this case s->runtime->control->appl_ptr has wrapped around.
* Play the data to the end of the boundary, then wrap our own
* appl_ptr back around.
*/
while (s->appl_ptr < s->runtime->boundary) {
if (bcom_queue_full(s->bcom_task))
return;
s->appl_ptr += s->period_size;
psc_dma_bcom_enqueue_next_buffer(s);
}
s->appl_ptr -= s->runtime->boundary;
}
while (s->appl_ptr < s->runtime->control->appl_ptr) {
if (bcom_queue_full(s->bcom_task))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册