mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
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: John Bonesio <bones@secretlab.ca> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
4bc4c9a5f5
commit
b0a2712ffd
1 changed files with 17 additions and 0 deletions
|
@ -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)
|
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) {
|
while (s->appl_ptr < s->runtime->control->appl_ptr) {
|
||||||
|
|
||||||
if (bcom_queue_full(s->bcom_task))
|
if (bcom_queue_full(s->bcom_task))
|
||||||
|
|
Loading…
Reference in a new issue