summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_asrc_m2m.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2017-06-15 15:50:50 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:48:26 +0800
commitce70583b4fd2dd862bf8a21357994db72e34661f (patch)
treeb28f7b44538e9b022c6a6f0850dd8cac53d4f405 /sound/soc/fsl/fsl_asrc_m2m.c
parent29668d659ece5d26fff7e5e9cef08520593400e1 (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/fsl_asrc_m2m.c')
-rw-r--r--sound/soc/fsl/fsl_asrc_m2m.c15
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);