Skip to content

Commit

Permalink
counter: Add STM32 Timer quadrature encoder
Browse files Browse the repository at this point in the history
Implement counter part of the STM32 timer hardware block by using
counter API. Hardware only supports X2 and X4 quadrature modes. A
ceiling value can be set to define the maximum value reachable by the
counter.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Co-authored-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
2 people authored and Greg Kroah-Hartman committed Apr 25, 2019
1 parent 7e798ef commit ad29937
Show file tree
Hide file tree
Showing 3 changed files with 401 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/counter/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,14 @@ config 104_QUAD_8
The base port addresses for the devices may be configured via the base
array module parameter.

config STM32_TIMER_CNT
tristate "STM32 Timer encoder counter driver"
depends on MFD_STM32_TIMERS || COMPILE_TEST
help
Select this option to enable STM32 Timer quadrature encoder
and counter driver.

To compile this driver as a module, choose M here: the
module will be called stm32-timer-cnt.

endif # COUNTER
1 change: 1 addition & 0 deletions drivers/counter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
obj-$(CONFIG_COUNTER) += counter.o

obj-$(CONFIG_104_QUAD_8) += 104-quad-8.o
obj-$(CONFIG_STM32_TIMER_CNT) += stm32-timer-cnt.o
Loading

0 comments on commit ad29937

Please sign in to comment.