drivers: dma: stm32 driver is using the STM32_DMA_STREAM_OFFSET

Includes the definition of the STM32_DMA_STREAM_OFFSET
depending on the peripheral to adjust the first DMA channel
in the list of streams.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2022-04-29 15:19:53 +02:00 committed by Carles Cufí
commit 005968a81f
2 changed files with 9 additions and 22 deletions

View file

@ -45,18 +45,6 @@ struct dma_stm32_config {
struct dma_stm32_stream *streams;
};
#if !defined(CONFIG_DMA_STM32_V1)
/* from DTS the dma stream id is in range 1..<dma-requests> */
/* so decrease to set range from 0 from now on */
#define STREAM_OFFSET 1
#elif defined(CONFIG_DMA_STM32_V1) && defined(CONFIG_DMAMUX_STM32)
/* typically on the stm32H7 serie, DMA V1 with mux */
#define STREAM_OFFSET 1
#else
/* from DTS the dma stream id is in range 0..<dma-requests>-1 */
#define STREAM_OFFSET 0
#endif /* ! CONFIG_DMA_STM32_V1 */
uint32_t dma_stm32_id_to_stream(uint32_t id);
#if !defined(CONFIG_DMAMUX_STM32)
uint32_t dma_stm32_slot_to_channel(uint32_t id);