mirror of https://github.com/thesofproject/sof.git
audio: dai-zephyr: Set source/destination address adjustment
Some DMACs (e.g: NXP's EDMA) can automatically adjust the source and destination addresses upon transfer completion. As such, we need to indicate how the adjustment should be performed. In the case of playback, the source address should be decremented, while in the case of capture, the destination address should be decremented. Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This commit is contained in:
parent
2c56be62ab
commit
87558f8260
|
@ -718,6 +718,13 @@ static int dai_set_dma_config(struct dai_data *dd, struct comp_dev *dev)
|
|||
dma_block_cfg->block_size = config->elem_array.elems[i].size;
|
||||
dma_block_cfg->source_address = config->elem_array.elems[i].src;
|
||||
dma_block_cfg->dest_address = config->elem_array.elems[i].dest;
|
||||
if (dev->direction == SOF_IPC_STREAM_PLAYBACK) {
|
||||
dma_block_cfg->source_addr_adj = DMA_ADDR_ADJ_DECREMENT;
|
||||
dma_block_cfg->dest_addr_adj = DMA_ADDR_ADJ_INCREMENT;
|
||||
} else {
|
||||
dma_block_cfg->source_addr_adj = DMA_ADDR_ADJ_INCREMENT;
|
||||
dma_block_cfg->dest_addr_adj = DMA_ADDR_ADJ_DECREMENT;
|
||||
}
|
||||
prev = dma_block_cfg;
|
||||
prev->next_block = ++dma_block_cfg;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue