OSDN Git Service

counter: stm32-timer-cnt: Report count function when SLAVE_MODE_DISABLED
authorWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Fri, 26 Feb 2021 01:29:31 +0000 (10:29 +0900)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 27 Feb 2021 16:10:28 +0000 (16:10 +0000)
commitfae6f62e6a580b663ecf42c2120a0898deae9137
tree8e790bad71c7aa67b35e32bd462d6867bac5d1fa
parent4f5434086d9223f20b3128a7dc78b35271e76655
counter: stm32-timer-cnt: Report count function when SLAVE_MODE_DISABLED

When in SLAVE_MODE_DISABLED mode, the count still increases if the
counter is enabled because an internal clock is used. This patch fixes
the stm32_count_function_get() and stm32_count_function_set() functions
to properly handle this behavior.

Fixes: ad29937e206f ("counter: Add STM32 Timer quadrature encoder")
Cc: Fabrice Gasnier <fabrice.gasnier@st.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@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/20210226012931.161429-1-vilhelm.gray@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/counter/stm32-timer-cnt.c