diff options
author | Fabrice Gasnier <fabrice.gasnier@foss.st.com> | 2023-08-29 16:40:25 +0300 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-11-01 13:02:12 +0300 |
commit | 1c7ea43fc42b09080657c83683846c4be672bd91 (patch) | |
tree | 5890f6e812ca2444df22fcc2551cb92bd10d585c /include | |
parent | 63416320419e99ea4c6530587658e5d14e9402ba (diff) | |
download | linux-1c7ea43fc42b09080657c83683846c4be672bd91.tar.xz |
mfd: stm32-timers: Add support for interrupts
There are two types of STM32 timers that may have:
- a global interrupt line
- 4 dedicated interrupt lines.
Those interrupts are optional as defined in the dt-bindings. Enforce checks
on either one, four or no interrupts are provided with their names.
Optionally get them here, to be used by child devices.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20230829134029.2402868-5-fabrice.gasnier@foss.st.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mfd/stm32-timers.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/mfd/stm32-timers.h b/include/linux/mfd/stm32-timers.h index 1b94325febb3..ca35af30745f 100644 --- a/include/linux/mfd/stm32-timers.h +++ b/include/linux/mfd/stm32-timers.h @@ -102,6 +102,15 @@ enum stm32_timers_dmas { STM32_TIMERS_MAX_DMAS, }; +/* STM32 Timer may have either a unique global interrupt or 4 interrupt lines */ +enum stm32_timers_irqs { + STM32_TIMERS_IRQ_GLOBAL_BRK, /* global or brk IRQ */ + STM32_TIMERS_IRQ_UP, + STM32_TIMERS_IRQ_TRG_COM, + STM32_TIMERS_IRQ_CC, + STM32_TIMERS_MAX_IRQS, +}; + /** * struct stm32_timers_dma - STM32 timer DMA handling. * @completion: end of DMA transfer completion @@ -123,6 +132,8 @@ struct stm32_timers { struct regmap *regmap; u32 max_arr; struct stm32_timers_dma dma; /* Only to be used by the parent */ + unsigned int nr_irqs; + int irq[STM32_TIMERS_MAX_IRQS]; }; #if IS_REACHABLE(CONFIG_MFD_STM32_TIMERS) |