Skip to content

Commit 106b104

Browse files
kamel-bouharajic23
authored andcommitted
counter: Add microchip TCB capture counter
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 <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 7eb181c commit 106b104

File tree

3 files changed

+409
-0
lines changed

3 files changed

+409
-0
lines changed

drivers/counter/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,15 @@ config FTM_QUADDEC
7070
To compile this driver as a module, choose M here: the
7171
module will be called ftm-quaddec.
7272

73+
config MICROCHIP_TCB_CAPTURE
74+
tristate "Microchip Timer Counter Capture driver"
75+
depends on HAS_IOMEM && OF
76+
select REGMAP_MMIO
77+
help
78+
Select this option to enable the Microchip Timer Counter Block
79+
capture driver.
80+
81+
To compile this driver as a module, choose M here: the
82+
module will be called microchip-tcb-capture.
83+
7384
endif # COUNTER

drivers/counter/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ obj-$(CONFIG_STM32_TIMER_CNT) += stm32-timer-cnt.o
1010
obj-$(CONFIG_STM32_LPTIMER_CNT) += stm32-lptimer-cnt.o
1111
obj-$(CONFIG_TI_EQEP) += ti-eqep.o
1212
obj-$(CONFIG_FTM_QUADDEC) += ftm-quaddec.o
13+
obj-$(CONFIG_MICROCHIP_TCB_CAPTURE) += microchip-tcb-capture.o

0 commit comments

Comments
 (0)