Search
SailfishOS Open Build Service
>
Projects
>
home:mike7b4
:
bbb
>
kernel-adaptation-bbb-v3.12
> 0017-sound-soc-soc-dmaengine-pcm-Add-support-for-new-DMAE.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0017-sound-soc-soc-dmaengine-pcm-Add-support-for-new-DMAE.patch of Package kernel-adaptation-bbb-v3.12
From 4518c0e85adfd1f1910adeff6070fa11f6e900b7 Mon Sep 17 00:00:00 2001 From: Joel Fernandes <joelf@ti.com> Date: Wed, 3 Jul 2013 17:29:44 -0500 Subject: [PATCH 17/96] sound: soc: soc-dmaengine-pcm: Add support for new DMAEngine request API Formerly these resources were coming HWMOD on OMAP-like SoCs. With the impending removal of HWMOD data, drivers are being converted to use the "of-dma" method of requesting DMA channels which from DT and can be obtained using the dma_request_slave_channel API. Add support to the soc-dmaengine-pcm helpers so that we can fetch and open channels using this method. Signed-off-by: Joel Fernandes <joelf@ti.com> --- sound/core/pcm_dmaengine.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c index aa924d9..461fe4f 100644 --- a/sound/core/pcm_dmaengine.c +++ b/sound/core/pcm_dmaengine.c @@ -276,6 +276,16 @@ struct dma_chan *snd_dmaengine_pcm_request_channel(dma_filter_fn filter_fn, } EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_request_channel); +struct dma_chan *snd_dmaengine_pcm_request_slave_channel( + struct snd_pcm_substream *substream, char *name) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct device *dev = snd_soc_dai_get_drvdata(rtd->cpu_dai); + + return dma_request_slave_channel(dev, name); +} +EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_request_slave_channel); + /** * snd_dmaengine_pcm_open - Open a dmaengine based PCM substream * @substream: PCM substream @@ -334,6 +344,18 @@ int snd_dmaengine_pcm_open_request_chan(struct snd_pcm_substream *substream, } EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_open_request_chan); +int snd_dmaengine_pcm_open_request_slave_chan(struct snd_pcm_substream *substream, char *name) +{ + if(substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + return snd_dmaengine_pcm_open(substream, + snd_dmaengine_pcm_request_slave_channel(substream, "tx")); + } else { + return snd_dmaengine_pcm_open(substream, + snd_dmaengine_pcm_request_slave_channel(substream, "rx")); + } +} +EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_open_request_slave_chan); + /** * snd_dmaengine_pcm_close - Close a dmaengine based PCM substream * @substream: PCM substream -- 1.9.1