[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1432646768-12532-14-git-send-email-peter.ujfalusi@ti.com>
Date: Tue, 26 May 2015 16:26:08 +0300
From: Peter Ujfalusi <peter.ujfalusi@...com>
To: <vinod.koul@...el.com>, <tony@...mide.com>
CC: <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<dan.j.williams@...el.com>, <dmaengine@...r.kernel.org>,
<linux-serial@...r.kernel.org>, <linux-omap@...r.kernel.org>,
<linux-mmc@...r.kernel.org>, <linux-crypto@...r.kernel.org>,
<linux-spi@...r.kernel.org>, <linux-media@...r.kernel.org>,
<alsa-devel@...a-project.org>, Mark Brown <broonie@...nel.org>,
Jarkko Nikula <jarkko.nikula@...mer.com>,
Liam Girdwood <lgirdwood@...il.com>
Subject: [PATCH 13/13] ASoC: omap-pcm: Switch to use dma_request_slave_channel_compat_reason()
dmaengine provides a wrapper function to handle DT and non DT boots when
requesting DMA channel. Use that instead of checking for of_node in the
platform driver.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@...com>
CC: Mark Brown <broonie@...nel.org>
CC: Jarkko Nikula <jarkko.nikula@...mer.com>
CC: Liam Girdwood <lgirdwood@...il.com>
---
sound/soc/omap/omap-pcm.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 52fd7cbbd1f4..ae04834f4697 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -132,6 +132,7 @@ static int omap_pcm_open(struct snd_pcm_substream *substream)
struct snd_dmaengine_dai_dma_data *dma_data;
struct dma_slave_caps dma_caps;
struct dma_chan *chan;
+ dma_cap_mask_t mask;
u32 addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) |
BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) |
BIT(DMA_SLAVE_BUSWIDTH_4_BYTES);
@@ -139,12 +140,15 @@ static int omap_pcm_open(struct snd_pcm_substream *substream)
dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
- if (rtd->cpu_dai->dev->of_node)
- chan = dma_request_slave_channel(rtd->cpu_dai->dev,
- dma_data->filter_data);
- else
- chan = snd_dmaengine_pcm_request_channel(omap_dma_filter_fn,
- dma_data->filter_data);
+ dma_cap_zero(mask);
+ dma_cap_set(DMA_SLAVE, mask);
+ dma_cap_set(DMA_CYCLIC, mask);
+ chan = dma_request_slave_channel_compat_reason(mask, omap_dma_filter_fn,
+ dma_data->filter_data, rtd->cpu_dai->dev,
+ dma_data->filter_data);
+
+ if (IS_ERR(chan))
+ return PTR_ERR(chan);
if (!dma_get_slave_caps(chan, &dma_caps)) {
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
--
2.3.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists