Update in order to use OMAP DMA DT binding for OMAP2+. In case
of DT boot snd_dmaengine_generic_pcm_open function is used.

Signed-off-by: Sebastien Guiriec <[email protected]>
---
 sound/soc/omap/omap-pcm.c |   12 ++++++++++--
 sound/soc/omap/omap-pcm.h |    1 +
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index c722c2e..df01a95 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -176,13 +176,21 @@ static int omap_pcm_open(struct snd_pcm_substream 
*substream)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct omap_pcm_dma_data *dma_data;
+       int ret;
 
        snd_soc_set_runtime_hwparams(substream, &omap_pcm_hardware);
 
        dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
 
-       return snd_dmaengine_pcm_open(substream, omap_dma_filter_fn,
-                                     &dma_data->dma_req);
+       if (rtd->cpu_dai->dev->of_node)
+               ret = snd_dmaengine_generic_pcm_open(substream,
+                                                    rtd->cpu_dai->dev,
+                                                    dma_data->dma_name);
+       else
+               ret = snd_dmaengine_pcm_open(substream, omap_dma_filter_fn,
+                                            &dma_data->dma_req);
+
+       return ret;
 }
 
 static int omap_pcm_close(struct snd_pcm_substream *substream)
diff --git a/sound/soc/omap/omap-pcm.h b/sound/soc/omap/omap-pcm.h
index cabe74c..06faa38 100644
--- a/sound/soc/omap/omap-pcm.h
+++ b/sound/soc/omap/omap-pcm.h
@@ -29,6 +29,7 @@ struct snd_pcm_substream;
 
 struct omap_pcm_dma_data {
        char            *name;          /* stream identifier */
+       char            *dma_name;      /* DMA request name */
        int             dma_req;        /* DMA request line */
        unsigned long   port_addr;      /* transmit/receive register */
        void (*set_threshold)(struct snd_pcm_substream *substream);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to