Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
[cascardo/linux.git] / sound / soc / samsung / i2s.c
index ea4ab37..84d9e77 100644 (file)
@@ -89,6 +89,7 @@ struct i2s_dai {
        struct s3c_dma_params dma_playback;
        struct s3c_dma_params dma_capture;
        struct s3c_dma_params idma_playback;
+       dma_filter_fn filter;
        u32     quirks;
        u32     suspend_i2smod;
        u32     suspend_i2scon;
@@ -1244,7 +1245,8 @@ static int samsung_i2s_probe(struct platform_device *pdev)
                if (ret != 0)
                        return ret;
 
-               return samsung_asoc_dma_platform_register(&pdev->dev);
+               return samsung_asoc_dma_platform_register(&pdev->dev,
+                                                         sec_dai->filter);
        }
 
        pri_dai = i2s_alloc_dai(pdev, false);
@@ -1257,27 +1259,15 @@ static int samsung_i2s_probe(struct platform_device *pdev)
        pri_dai->lock = &pri_dai->spinlock;
 
        if (!np) {
-               res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
-               if (!res) {
-                       dev_err(&pdev->dev,
-                               "Unable to get I2S-TX dma resource\n");
-                       return -ENXIO;
-               }
-               pri_dai->dma_playback.channel = res->start;
-
-               res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
-               if (!res) {
-                       dev_err(&pdev->dev,
-                               "Unable to get I2S-RX dma resource\n");
-                       return -ENXIO;
-               }
-               pri_dai->dma_capture.channel = res->start;
-
                if (i2s_pdata == NULL) {
                        dev_err(&pdev->dev, "Can't work without s3c_audio_pdata\n");
                        return -EINVAL;
                }
 
+               pri_dai->dma_playback.slave = i2s_pdata->dma_playback;
+               pri_dai->dma_capture.slave = i2s_pdata->dma_capture;
+               pri_dai->filter = i2s_pdata->dma_filter;
+
                if (&i2s_pdata->type)
                        i2s_cfg = &i2s_pdata->type.i2s;
 
@@ -1339,9 +1329,8 @@ static int samsung_i2s_probe(struct platform_device *pdev)
                sec_dai->dma_playback.ch_name = "tx-sec";
 
                if (!np) {
-                       res = platform_get_resource(pdev, IORESOURCE_DMA, 2);
-                       if (res)
-                               sec_dai->dma_playback.channel = res->start;
+                       sec_dai->dma_playback.slave = i2s_pdata->dma_play_sec;
+                       sec_dai->filter = i2s_pdata->dma_filter;
                }
 
                sec_dai->dma_playback.dma_size = 4;
@@ -1364,7 +1353,7 @@ static int samsung_i2s_probe(struct platform_device *pdev)
 
        pm_runtime_enable(&pdev->dev);
 
-       ret = samsung_asoc_dma_platform_register(&pdev->dev);
+       ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter);
        if (ret != 0)
                return ret;