Skip to content

Commit 05593a3

Browse files
William Breathitt GrayJonathan Cameron
authored andcommitted
counter: stm32-lptimer-cnt: Provide defines for clock polarities
The STM32 low-power timer permits configuration of the clock polarity via the LPTIMX_CFGR register CKPOL bits. This patch provides preprocessor defines for the supported clock polarities. Cc: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Link: https://lore.kernel.org/r/a111c8905c467805ca530728f88189b59430f27e.1630031207.git.vilhelm.gray@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 6880fa6 commit 05593a3

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎drivers/counter/stm32-lptimer-cnt.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ static const enum counter_function stm32_lptim_cnt_functions[] = {
140140
};
141141

142142
enum stm32_lptim_synapse_action {
143-
STM32_LPTIM_SYNAPSE_ACTION_RISING_EDGE,
144-
STM32_LPTIM_SYNAPSE_ACTION_FALLING_EDGE,
145-
STM32_LPTIM_SYNAPSE_ACTION_BOTH_EDGES,
143+
STM32_LPTIM_SYNAPSE_ACTION_RISING_EDGE = STM32_LPTIM_CKPOL_RISING_EDGE,
144+
STM32_LPTIM_SYNAPSE_ACTION_FALLING_EDGE = STM32_LPTIM_CKPOL_FALLING_EDGE,
145+
STM32_LPTIM_SYNAPSE_ACTION_BOTH_EDGES = STM32_LPTIM_CKPOL_BOTH_EDGES,
146146
STM32_LPTIM_SYNAPSE_ACTION_NONE,
147147
};
148148

‎include/linux/mfd/stm32-lptimer.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
#define STM32_LPTIM_PRESC GENMASK(11, 9)
4646
#define STM32_LPTIM_CKPOL GENMASK(2, 1)
4747

48+
/* STM32_LPTIM_CKPOL */
49+
#define STM32_LPTIM_CKPOL_RISING_EDGE 0
50+
#define STM32_LPTIM_CKPOL_FALLING_EDGE 1
51+
#define STM32_LPTIM_CKPOL_BOTH_EDGES 2
52+
4853
/* STM32_LPTIM_ARR */
4954
#define STM32_LPTIM_MAX_ARR 0xFFFF
5055

0 commit comments

Comments
 (0)