Skip to content

Commit

Permalink
audio: dai-zephyr: Set source/destination address adjustment
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
LaurentiuM1234 committed Feb 22, 2024
1 parent 434adbe commit 4f6c115
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/audio/dai-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4f6c115

Please sign in to comment.