Commit 6f1fd93e authored by Shawn Guo's avatar Shawn Guo Committed by Mark Brown

ASoC: generic-dmaengine-pcm: call dma_request_slave_channel()

dma_request_slave_channel() is a more appropriate API for dmaengine
clients that adopt generic DMA bindings to call.  Let's use it instead
of of_dma_request_slave_channel() to save <linux/of_dma.h> include.
Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 19133d2c
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <sound/soc.h> #include <sound/soc.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_dma.h>
#include <sound/dmaengine_pcm.h> #include <sound/dmaengine_pcm.h>
...@@ -219,19 +218,19 @@ static const char * const dmaengine_pcm_dma_channel_names[] = { ...@@ -219,19 +218,19 @@ static const char * const dmaengine_pcm_dma_channel_names[] = {
}; };
static void dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm, static void dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm,
struct device_node *of_node) struct device *dev)
{ {
unsigned int i; unsigned int i;
if ((pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_DT) || !of_node) if ((pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_DT) || !dev->of_node)
return; return;
if (pcm->flags & SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX) { if (pcm->flags & SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX) {
pcm->chan[0] = of_dma_request_slave_channel(of_node, "rx-tx"); pcm->chan[0] = dma_request_slave_channel(dev, "rx-tx");
pcm->chan[1] = pcm->chan[0]; pcm->chan[1] = pcm->chan[0];
} else { } else {
for (i = SNDRV_PCM_STREAM_PLAYBACK; i <= SNDRV_PCM_STREAM_CAPTURE; i++) { for (i = SNDRV_PCM_STREAM_PLAYBACK; i <= SNDRV_PCM_STREAM_CAPTURE; i++) {
pcm->chan[i] = of_dma_request_slave_channel(of_node, pcm->chan[i] = dma_request_slave_channel(dev,
dmaengine_pcm_dma_channel_names[i]); dmaengine_pcm_dma_channel_names[i]);
} }
} }
...@@ -255,7 +254,7 @@ int snd_dmaengine_pcm_register(struct device *dev, ...@@ -255,7 +254,7 @@ int snd_dmaengine_pcm_register(struct device *dev,
pcm->config = config; pcm->config = config;
pcm->flags = flags; pcm->flags = flags;
dmaengine_pcm_request_chan_of(pcm, dev->of_node); dmaengine_pcm_request_chan_of(pcm, dev);
if (flags & SND_DMAENGINE_PCM_FLAG_NO_RESIDUE) if (flags & SND_DMAENGINE_PCM_FLAG_NO_RESIDUE)
return snd_soc_add_platform(dev, &pcm->platform, return snd_soc_add_platform(dev, &pcm->platform,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment