]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
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)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:14 +0000 (15:42 -0500)
commit913d0e2b1d10244b43e4260912a7c447471802ee
tree7561c3db483f6246baf26344f7b3ee5a50fa4427
parent2b6277fc1aabf2d30c325ca540e77ea0fa70e6ac
counter: stm32-timer-cnt: Report count function when SLAVE_MODE_DISABLED

BugLink: https://bugs.launchpad.net/bugs/1921712
[ Upstream commit fae6f62e6a580b663ecf42c2120a0898deae9137 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/counter/stm32-timer-cnt.c