drivers: flash: stm32 qspi driver with a valid dma and its channel

Fix the dma instance when a DMAMUX is enabled.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2023-03-15 16:43:53 +01:00 committed by Maureen Helm
parent c6e20d2c4b
commit 64f6503eba

View file

@ -1140,10 +1140,9 @@ static int flash_stm32_qspi_init(const struct device *dev)
#else
hdma.Init.Request = dma_cfg.dma_slot;
#ifdef CONFIG_DMAMUX_STM32
/* HAL expects a valid DMA channel (not DAMMUX) */
/* TODO: Get DMA instance from DT */
hdma.Instance = __LL_DMA_GET_CHANNEL_INSTANCE(DMA1,
dev_data->dma.channel+1);
/* HAL expects a valid DMA channel (not a DMAMUX channel) */
hdma.Instance = __LL_DMA_GET_CHANNEL_INSTANCE(dev_data->dma.reg,
dev_data->dma.channel);
#else
hdma.Instance = __LL_DMA_GET_CHANNEL_INSTANCE(dev_data->dma.reg,
dev_data->dma.channel-1);