Skip to content

Commit

Permalink
ASoC: rockchip: multi_dais_pcm: prepare dma cyclic buffer
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Sugar Zhang authored and rkhuangtao committed Jun 1, 2018
1 parent 191583d commit f113aef
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions sound/soc/rockchip/rockchip_multi_dais_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit f113aef

Please sign in to comment.