Skip to content

Commit

Permalink
counter: Add microchip TCB capture counter
Browse files Browse the repository at this point in the history
This drivers allows to use the capture mode of the Timer Counter Block
hardware block available in Microchip SoCs through the counter subsystem.

Two functions of the counter are supported for the moment: period
capture and quadrature decoder. The latter is only supported by the
SAMA5 series of SoCs.

For the period capture mode a basic setup has been chosen that will
reset the counter each time the period is actually reached. Of course
the device offers much more possibilities.

For quadrature mode, both channel 0 and 1 must be configured even if we
only capture the position (no revolution/rotation).

Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
kamel-bouhara authored and jic23 committed Jul 20, 2020
1 parent 7eb181c commit 106b104
Show file tree
Hide file tree
Showing 3 changed files with 409 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/counter/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,15 @@ config FTM_QUADDEC
To compile this driver as a module, choose M here: the
module will be called ftm-quaddec.

config MICROCHIP_TCB_CAPTURE
tristate "Microchip Timer Counter Capture driver"
depends on HAS_IOMEM && OF
select REGMAP_MMIO
help
Select this option to enable the Microchip Timer Counter Block
capture driver.

To compile this driver as a module, choose M here: the
module will be called microchip-tcb-capture.

endif # COUNTER
1 change: 1 addition & 0 deletions drivers/counter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ obj-$(CONFIG_STM32_TIMER_CNT) += stm32-timer-cnt.o
obj-$(CONFIG_STM32_LPTIMER_CNT) += stm32-lptimer-cnt.o
obj-$(CONFIG_TI_EQEP) += ti-eqep.o
obj-$(CONFIG_FTM_QUADDEC) += ftm-quaddec.o
obj-$(CONFIG_MICROCHIP_TCB_CAPTURE) += microchip-tcb-capture.o

0 comments on commit 106b104

Please sign in to comment.