diff options
author | Shengjiu Wang <shengjiu.wang@freescale.com> | 2017-06-15 15:50:50 +0800 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:26:49 +0800 |
commit | 7f74c027f1ef9fa8d77820bf9b45a4c23ca17026 (patch) | |
tree | 8c8f8d6deaa272ce6812bac97cfe2f3cecdd6f02 /sound/soc/fsl | |
parent | 1b885c1252ce388cf8382a0ea840a5861b929c9e (diff) |
MLK-15061-1: ASoC: fsl_asrc_m2m: fix dma_map_sg issue for arm64
For arm64, the dma_map_sg and dma_unmap_sg need the device parameter,
otherwise, it will return error.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r-- | sound/soc/fsl/fsl_asrc_m2m.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c index f0b335697445..201b307d8a9c 100644 --- a/sound/soc/fsl/fsl_asrc_m2m.c +++ b/sound/soc/fsl/fsl_asrc_m2m.c @@ -216,7 +216,7 @@ static int fsl_asrc_dmaconfig(struct fsl_asrc_pair *pair, struct dma_chan *chan, return -EINVAL; } - ret = dma_map_sg(NULL, sg, sg_nent, slave_config.direction); + ret = dma_map_sg(&asrc_priv->pdev->dev, sg, sg_nent, slave_config.direction); if (ret != sg_nent) { pair_err("failed to map DMA sg for %sput task\n", DIR_STR(dir)); return -EINVAL; @@ -331,17 +331,18 @@ int fsl_asrc_process_buffer_pre(struct completion *complete, return 0; } -#define mxc_asrc_dma_umap(m2m) \ +#define mxc_asrc_dma_umap(dev, m2m) \ do { \ - dma_unmap_sg(NULL, m2m->sg[IN], m2m->sg_nodes[IN], \ + dma_unmap_sg(dev, m2m->sg[IN], m2m->sg_nodes[IN], \ DMA_MEM_TO_DEV); \ - dma_unmap_sg(NULL, m2m->sg[OUT], m2m->sg_nodes[OUT], \ + dma_unmap_sg(dev, m2m->sg[OUT], m2m->sg_nodes[OUT], \ DMA_DEV_TO_MEM); \ } while (0) int fsl_asrc_process_buffer(struct fsl_asrc_pair *pair, struct asrc_convert_buffer *pbuf) { + struct fsl_asrc *asrc_priv = pair->asrc_priv; struct fsl_asrc_m2m *m2m = pair->private; enum asrc_pair_index index = pair->index; unsigned long lock_flags; @@ -350,18 +351,18 @@ int fsl_asrc_process_buffer(struct fsl_asrc_pair *pair, /* Check input task first */ ret = fsl_asrc_process_buffer_pre(&m2m->complete[IN], index, IN); if (ret) { - mxc_asrc_dma_umap(m2m); + mxc_asrc_dma_umap(&asrc_priv->pdev->dev, m2m); return ret; } /* ...then output task*/ ret = fsl_asrc_process_buffer_pre(&m2m->complete[OUT], index, OUT); if (ret) { - mxc_asrc_dma_umap(m2m); + mxc_asrc_dma_umap(&asrc_priv->pdev->dev, m2m); return ret; } - mxc_asrc_dma_umap(m2m); + mxc_asrc_dma_umap(&asrc_priv->pdev->dev, m2m); /* Fetch the remaining data */ spin_lock_irqsave(&m2m->lock, lock_flags); |