From ddb6a8fb2bddb8fd34ea71a116a1719fe45bbae0 Mon Sep 17 00:00:00 2001 From: Viorel Suman Date: Tue, 16 Apr 2019 14:25:55 +0300 Subject: [PATCH] MLK-21460: ASoC: imx-audmix: fix dummy device DMA ops 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 Reviewed-by: Daniel Baluta --- sound/soc/fsl/imx-audmix.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sound/soc/fsl/imx-audmix.c b/sound/soc/fsl/imx-audmix.c index a794c4d52f44..e53112c94064 100644 --- a/sound/soc/fsl/imx-audmix.c +++ b/sound/soc/fsl/imx-audmix.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #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); -- 2.17.1