ASoC: samsung: dmaengine: Allow to specify custom DMA device 39/197839/5
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Thu, 7 Feb 2019 17:00:11 +0000 (18:00 +0100)
committerSylwester Nawrocki <s.nawrocki@samsung.com>
Mon, 4 Mar 2019 17:05:33 +0000 (18:05 +0100)
The additional function argument will allow to select proper DMA device
for requesting DMA channel for the secondary CPU DAI.

Change-Id: I3848594e393bcf55770020857ee5f2d0271b779b
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/samsung/dma.h
sound/soc/samsung/dmaengine.c
sound/soc/samsung/i2s.c
sound/soc/samsung/pcm.c
sound/soc/samsung/s3c2412-i2s.c
sound/soc/samsung/s3c24xx-i2s.c
sound/soc/samsung/spdif.c

index 7ae580d..0ae15d0 100644 (file)
@@ -17,5 +17,6 @@
  * otherwise actual DMA channel names must be passed to this function.
  */
 int samsung_asoc_dma_platform_register(struct device *dev, dma_filter_fn filter,
-                                      const char *tx, const char *rx);
+                                      const char *tx, const char *rx,
+                                      struct device *dma_dev);
 #endif /* _SAMSUNG_DMA_H */
index 9104c98..84601fa 100644 (file)
@@ -25,7 +25,8 @@
 #include "dma.h"
 
 int samsung_asoc_dma_platform_register(struct device *dev, dma_filter_fn filter,
-                                      const char *tx, const char *rx)
+                                      const char *tx, const char *rx,
+                                      struct device *dma_dev)
 {
        unsigned int flags = SND_DMAENGINE_PCM_FLAG_COMPAT;
        struct snd_dmaengine_pcm_config *pcm_conf;
@@ -36,6 +37,7 @@ int samsung_asoc_dma_platform_register(struct device *dev, dma_filter_fn filter,
 
        pcm_conf->prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config;
        pcm_conf->compat_filter_fn = filter;
+       pcm_conf->dma_dev = dma_dev;
 
        if (dev->of_node) {
                pcm_conf->chan_names[SNDRV_PCM_STREAM_PLAYBACK] = tx;
index b712c02..0763203 100644 (file)
@@ -1350,7 +1350,7 @@ static int samsung_i2s_probe(struct platform_device *pdev)
                pri_dai->i2s_dai_drv.playback.channels_max = 6;
 
        ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
-                                                NULL, NULL);
+                                                NULL, NULL, NULL);
        if (ret < 0)
                goto err_disable_clk;
 
@@ -1387,7 +1387,7 @@ static int samsung_i2s_probe(struct platform_device *pdev)
                pri_dai->sec_dai = sec_dai;
 
                ret = samsung_asoc_dma_platform_register(&pdev->dev,
-                                       sec_dai->filter, "tx-sec", NULL);
+                                       sec_dai->filter, "tx-sec", NULL, NULL);
                if (ret < 0)
                        goto err_disable_clk;
 
index 37f95ee..3c7baa5 100644 (file)
@@ -553,7 +553,7 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
        pcm->dma_playback = &s3c_pcm_stereo_out[pdev->id];
 
        ret = samsung_asoc_dma_platform_register(&pdev->dev, filter,
-                                                NULL, NULL);
+                                                NULL, NULL, NULL);
        if (ret) {
                dev_err(&pdev->dev, "failed to get register DMA: %d\n", ret);
                goto err_dis_pclk;
index cc0840f..67dfa27 100644 (file)
@@ -177,7 +177,7 @@ static int s3c2412_iis_dev_probe(struct platform_device *pdev)
 
        ret = samsung_asoc_dma_platform_register(&pdev->dev,
                                                 pdata->dma_filter,
-                                                NULL, NULL);
+                                                NULL, NULL, NULL);
        if (ret) {
                pr_err("failed to register the DMA: %d\n", ret);
                return ret;
index 8d58d02..ba0f2b9 100644 (file)
@@ -446,7 +446,7 @@ static int s3c24xx_iis_dev_probe(struct platform_device *pdev)
        s3c24xx_i2s_pcm_stereo_in.addr = res->start + S3C2410_IISFIFO;
 
        ret = samsung_asoc_dma_platform_register(&pdev->dev, NULL,
-                                                NULL, NULL);
+                                                NULL, NULL, NULL);
        if (ret) {
                dev_err(&pdev->dev, "Failed to register the DMA: %d\n", ret);
                return ret;
index cb59911..5e4afb3 100644 (file)
@@ -430,7 +430,7 @@ static int spdif_probe(struct platform_device *pdev)
        spdif->dma_playback = &spdif_stereo_out;
 
        ret = samsung_asoc_dma_platform_register(&pdev->dev, filter,
-                                                NULL, NULL);
+                                                NULL, NULL, NULL);
        if (ret) {
                dev_err(&pdev->dev, "failed to register DMA: %d\n", ret);
                goto err4;