Skip to content

Commit 08725d4

Browse files
Sugar Zhangrkhuangtao
authored andcommitted
ASoC: rockchip: multi_dais_pcm: refine dma slave config
This patch refine dma slave config only when interlace size is valid. Change-Id: If02cec29083d5f582ccd0efcd78e7a6547d2df66 Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
1 parent 8be761e commit 08725d4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

sound/soc/rockchip/rockchip_multi_dais_pcm.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,16 @@ static int dmaengine_mpcm_hw_params(struct snd_pcm_substream *substream,
271271
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
272272
chan = pcm->tx_chans[i];
273273
if (sz) {
274-
slave_config.dst_maxburst = sz / slave_config.dst_addr_width;
275274
slave_config.src_interlace_size = frame_bytes - sz;
275+
if (slave_config.src_interlace_size)
276+
slave_config.dst_maxburst = sz / slave_config.dst_addr_width;
276277
}
277278
} else {
278279
chan = pcm->rx_chans[i];
279280
if (sz) {
280-
slave_config.src_maxburst = sz / slave_config.src_addr_width;
281281
slave_config.dst_interlace_size = frame_bytes - sz;
282+
if (slave_config.dst_interlace_size)
283+
slave_config.src_maxburst = sz / slave_config.src_addr_width;
282284
}
283285
}
284286
if (!chan)

0 commit comments

Comments
 (0)