drivers: dma: stm32: refactor irq handling
- Remove the need for kmalloc - On hardware that supports it use 1 IRQ handler per stream to determine the stream ID, so the ISR does not have to loop over all ID's to see which one is active. On hardware (like STM32L0 and STM32F0) where up to 7 streams share 3 IRQ's use the loop to check which stream is active. Signed-off-by: Erwin Rol <erwin@erwinrol.com>
This commit is contained in:
parent
c8ae070de7
commit
67f68e68f1
5 changed files with 247 additions and 103 deletions
|
@ -24,8 +24,6 @@ struct dma_stm32_stream {
|
|||
};
|
||||
|
||||
struct dma_stm32_data {
|
||||
int max_streams;
|
||||
struct dma_stm32_stream *streams;
|
||||
};
|
||||
|
||||
struct dma_stm32_config {
|
||||
|
@ -33,6 +31,8 @@ struct dma_stm32_config {
|
|||
void (*config_irq)(const struct device *dev);
|
||||
bool support_m2m;
|
||||
uint32_t base;
|
||||
uint32_t max_streams;
|
||||
struct dma_stm32_stream *streams;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DMA_STM32_V1
|
||||
|
@ -57,6 +57,8 @@ extern void (*func_ll_clear_gi[])(DMA_TypeDef *DMAx);
|
|||
extern uint32_t table_ll_channel[];
|
||||
#endif
|
||||
|
||||
bool stm32_dma_is_irq_active(DMA_TypeDef *dma, uint32_t id);
|
||||
|
||||
void stm32_dma_dump_stream_irq(DMA_TypeDef *dma, uint32_t id);
|
||||
void stm32_dma_clear_stream_irq(DMA_TypeDef *dma, uint32_t id);
|
||||
bool stm32_dma_is_irq_happened(DMA_TypeDef *dma, uint32_t id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue