MLK-21460: ASoC: imx-audmix: fix dummy device DMA ops
authorViorel Suman <viorel.suman@nxp.com>
Tue, 16 Apr 2019 11:25:55 +0000 (14:25 +0300)
committerViorel Suman <viorel.suman@nxp.com>
Thu, 18 Apr 2019 08:24:39 +0000 (11:24 +0300)
The device is not created from a device tree node, so arch_setup_dma_ops
is not called, thus leaving the device with dummy DMA ops. Fix this by
calling of_dma_configure() with a NULL node to set default DMA ops.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
sound/soc/fsl/imx-audmix.c

index a794c4d..e53112c 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/clk.h>
 #include <sound/soc.h>
 #include <sound/soc-dapm.h>
+#include <linux/dma-mapping.h>
 #include <linux/pm_runtime.h>
 #include "fsl_sai.h"
 #include "fsl_audmix.h"
@@ -307,6 +308,19 @@ static int imx_audmix_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, &priv->card);
        snd_soc_card_set_drvdata(&priv->card, priv);
 
+       /*
+        * The device is not created from a device tree node, so
+        * arch_setup_dma_ops is not called, thus leaving the device with dummy
+        * DMA ops. Fix this by calling of_dma_configure() with a NULL node to
+        * set default DMA ops.
+        */
+       pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+       ret = of_dma_configure(&pdev->dev, NULL, true);
+       if (ret < 0) {
+               dev_err(&pdev->dev, "Cannot setup DMA ops: %d\n", ret);
+               return ret;
+       }
+
        ret = devm_snd_soc_register_card(&pdev->dev, &priv->card);
        if (ret) {
                dev_err(&pdev->dev, "snd_soc_register_card failed: %d\n", ret);