drivers: edma: Set dmamux interruption according to hardware

SOF use sai6 on imx8ulp 9x9 board, use sai5 on imx8ulp board.
Modify for compatible with different imx8ulp boards.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
This commit is contained in:
Zhang Peng 2022-01-28 14:40:48 +08:00 committed by Liam Girdwood
parent baefbd6b67
commit 56010471eb
1 changed files with 13 additions and 3 deletions

View File

@ -286,6 +286,10 @@ static int edma_setup_tcd(struct dma_chan_data *channel, int16_t soff,
int dest_width, uint32_t burst_elems)
{
int rc;
#ifdef CONFIG_IMX8ULP
struct dai_data *dd = channel->dev_data;
int direction, handshake, dmamux_cfg;
#endif
uint32_t sbase, dbase, total_size, elem_count, elem_size, size;
assert(!sg);
@ -336,10 +340,16 @@ static int edma_setup_tcd(struct dma_chan_data *channel, int16_t soff,
/* Do not write EDMA_CH_MUX register when it has value,
* otherwise the register will be cleared.
*/
if (channel->direction == DMA_DIR_MEM_TO_DEV)
direction = DAI_DIR_PLAYBACK;
else
direction = DAI_DIR_CAPTURE;
handshake = dai_get_handshake(dd->dai, direction, 0);
dmamux_cfg = EDMA_HS_GET_DMAMUX_CFG(handshake);
if (!dma_chan_reg_read(channel, EDMA_CH_MUX))
(channel->direction == DMA_DIR_MEM_TO_DEV) ?
dma_chan_reg_write(channel, EDMA_CH_MUX, IMX8ULP_DMAMUX2_SAI5_TX) :
dma_chan_reg_write(channel, EDMA_CH_MUX, IMX8ULP_DMAMUX2_SAI5_RX);
dma_chan_reg_write(channel, EDMA_CH_MUX, dmamux_cfg);
#endif
chan_addr_convert(channel, &sbase, &dbase);