Skip to content

Commit

Permalink
audio: dai-zephyr: Allow address decrement/increment on NXP's EDMA
Browse files Browse the repository at this point in the history
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 the one being decremented.

Signed-off-by: Laurentiu Mihalcea <[email protected]>
  • Loading branch information
LaurentiuM1234 committed Feb 13, 2024
1 parent 9a0fa37 commit a33816b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/audio/dai-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,15 @@ 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 (IS_ENABLED(CONFIG_DMA_NXP_EDMA)) {
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;
}
Expand Down

0 comments on commit a33816b

Please sign in to comment.