]> git.baikalelectronics.ru Git - kernel.git/commit
counter: Add microchip TCB capture counter
authorKamel Bouhara <kamel.bouhara@bootlin.com>
Mon, 6 Jul 2020 11:43:47 +0000 (13:43 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 20 Jul 2020 12:04:40 +0000 (13:04 +0100)
commit105615d1c7822924170d2246483667a5347a5a61
treed25a252e00960f2fd587313069b96b06a69751fd
parent8930ef8580ebe9b147f4ee704163c793ca3cfb0a
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 <kamel.bouhara@bootlin.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/counter/Kconfig
drivers/counter/Makefile
drivers/counter/microchip-tcb-capture.c [new file with mode: 0644]