counter: stm32-timer-cnt: probe number of channels from registers
authorFabrice Gasnier <fabrice.gasnier@foss.st.com>
Thu, 7 Mar 2024 13:33:04 +0000 (14:33 +0100)
committerWilliam Breathitt Gray <wbg@kernel.org>
Tue, 2 Apr 2024 17:10:34 +0000 (13:10 -0400)
commitf7630270b67836bedc518e96fb4c64b11fe3fb5e
tree6a34cef4bd15b4ccd3025cb5137b932e1cf03064
parentefec660d78f06cd1101b3300ebfef4918cc0f63f
counter: stm32-timer-cnt: probe number of channels from registers

Probe the number of capture compare channels, by writing CCER register bits
and read them back. Take care to restore the register original value.

This is a precursor patch to support capture channels.

Reviewed-by: William Breathitt Gray <william.gray@linaro.org>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20240307133306.383045-9-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
drivers/counter/stm32-timer-cnt.c