Skip to content

Commit

Permalink
ASoC: txx9: Don't opencode DMAengine API calls
Browse files Browse the repository at this point in the history
Use the proper wrapper functions instead of directly calling the DMAengine
callback functions.

Also add the missing include to linux/dmaengine.h.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Aug 19, 2014
1 parent 7d1311b commit ff495d3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sound/soc/txx9/txx9aclc.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/platform_device.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/dmaengine.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
Expand Down Expand Up @@ -137,7 +138,7 @@ txx9aclc_dma_submit(struct txx9aclc_dmadata *dmadata, dma_addr_t buf_dma_addr)
}
desc->callback = txx9aclc_dma_complete;
desc->callback_param = dmadata;
desc->tx_submit(desc);
dmaengine_submit(desc);
return desc;
}

Expand All @@ -160,7 +161,7 @@ static void txx9aclc_dma_tasklet(unsigned long data)
void __iomem *base = drvdata->base;

spin_unlock_irqrestore(&dmadata->dma_lock, flags);
chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
dmaengine_terminate_all(chan);
/* first time */
for (i = 0; i < NR_DMA_CHAIN; i++) {
desc = txx9aclc_dma_submit(dmadata,
Expand All @@ -169,7 +170,7 @@ static void txx9aclc_dma_tasklet(unsigned long data)
return;
}
dmadata->dmacount = NR_DMA_CHAIN;
chan->device->device_issue_pending(chan);
dma_async_issue_pending(chan);
spin_lock_irqsave(&dmadata->dma_lock, flags);
__raw_writel(ctlbit, base + ACCTLEN);
dmadata->frag_count = NR_DMA_CHAIN % dmadata->frags;
Expand All @@ -188,7 +189,7 @@ static void txx9aclc_dma_tasklet(unsigned long data)
dmadata->frag_count * dmadata->frag_bytes);
if (!desc)
return;
chan->device->device_issue_pending(chan);
dma_async_issue_pending(chan);

spin_lock_irqsave(&dmadata->dma_lock, flags);
dmadata->frag_count++;
Expand Down Expand Up @@ -266,7 +267,7 @@ static int txx9aclc_pcm_close(struct snd_pcm_substream *substream)
struct dma_chan *chan = dmadata->dma_chan;

dmadata->frag_count = -1;
chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
dmaengine_terminate_all(chan);
return 0;
}

Expand Down Expand Up @@ -398,8 +399,7 @@ static int txx9aclc_pcm_remove(struct snd_soc_platform *platform)
struct dma_chan *chan = dmadata->dma_chan;
if (chan) {
dmadata->frag_count = -1;
chan->device->device_control(chan,
DMA_TERMINATE_ALL, 0);
dmaengine_terminate_all(chan);
dma_release_channel(chan);
}
dev->dmadata[i].dma_chan = NULL;
Expand Down

0 comments on commit ff495d3

Please sign in to comment.