From f113aefebc63513f4f90810a6ee0f5e9f1a34846 Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Thu, 31 May 2018 19:51:05 +0800 Subject: [PATCH] ASoC: rockchip: multi_dais_pcm: prepare dma cyclic buffer This patch prepare dma cyclic with total buffersize, and let the dmaengine to handle the interlace buffer. Change-Id: Ic0ee647e006c72c7eedc77a30d1e2d0eb902f120 Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_multi_dais_pcm.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/sound/soc/rockchip/rockchip_multi_dais_pcm.c b/sound/soc/rockchip/rockchip_multi_dais_pcm.c index 959756a12b190..6a4b6b3fca6d3 100644 --- a/sound/soc/rockchip/rockchip_multi_dais_pcm.c +++ b/sound/soc/rockchip/rockchip_multi_dais_pcm.c @@ -102,9 +102,8 @@ static int dmaengine_mpcm_prepare_and_submit(struct snd_pcm_substream *substream enum dma_transfer_direction direction; unsigned long flags = DMA_CTRL_ACK; unsigned int *maps = prtd->channel_maps; - unsigned int channels = runtime->channels; int offset, buffer_bytes, period_bytes; - int i, pb, bb; + int i; bool callback = false; direction = snd_pcm_substream_to_dma_direction(substream); @@ -118,16 +117,10 @@ static int dmaengine_mpcm_prepare_and_submit(struct snd_pcm_substream *substream for (i = 0; i < prtd->num_chans; i++) { if (!prtd->chans[i]) continue; - pb = period_bytes; - bb = buffer_bytes; - if (maps[i]) { - pb = pb * maps[i] / channels; - bb = bb * maps[i] / channels; - } - pr_debug("offset: %d, pb: %d, bb: %d\n", offset, pb, bb); desc = dmaengine_prep_dma_cyclic(prtd->chans[i], runtime->dma_addr + offset, - bb, pb, direction, flags); + buffer_bytes, period_bytes, + direction, flags); if (!desc) return -ENOMEM;