Skip to content

Commit 0be8907

Browse files
bijudaslag-linaro
authored andcommitted
counter: Add Renesas RZ/G2L MTU3a counter driver
Add RZ/G2L MTU3a counter driver. This IP supports the following phase counting modes on MTU1 and MTU2 channels 1) 16-bit phase counting modes on MTU1 and MTU2 channels. 2) 32-bit phase counting mode by cascading MTU1 and MTU2 channels. This patch adds 3 counter value channels. count0: 16-bit phase counter value channel on MTU1 count1: 16-bit phase counter value channel on MTU2 count2: 32-bit phase counter value channel by cascading MTU1 and MTU2 channels. The external input phase clock pin for the counter value channels are as follows: count0: "MTCLKA-MTCLKB" count1: "MTCLKA-MTCLKB" or "MTCLKC-MTCLKD" count2: "MTCLKA-MTCLKB" or "MTCLKC-MTCLKD" Use the sysfs variable "external_input_phase_clock_select" to select the external input phase clock pin and "cascade_counts_enable" to enable/ disable cascading of channels. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: William Breathitt Gray <william.gray@linaro.org> Acked-by: William Breathitt Gray <william.gray@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230330111632.169434-5-biju.das.jz@bp.renesas.com
1 parent 7bb985a commit 0be8907

3 files changed

Lines changed: 914 additions & 0 deletions

File tree

drivers/counter/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ config MICROCHIP_TCB_CAPTURE
7373
To compile this driver as a module, choose M here: the
7474
module will be called microchip-tcb-capture.
7575

76+
config RZ_MTU3_CNT
77+
tristate "Renesas RZ/G2L MTU3a counter driver"
78+
depends on RZ_MTU3 || COMPILE_TEST
79+
help
80+
Enable support for MTU3a counter driver found on Renesas RZ/G2L alike
81+
SoCs. This IP supports both 16-bit and 32-bit phase counting mode
82+
support.
83+
84+
To compile this driver as a module, choose M here: the
85+
module will be called rz-mtu3-cnt.
86+
7687
config STM32_LPTIMER_CNT
7788
tristate "STM32 LP Timer encoder counter driver"
7889
depends on MFD_STM32_LPTIMER || COMPILE_TEST

drivers/counter/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ counter-y := counter-core.o counter-sysfs.o counter-chrdev.o
88

99
obj-$(CONFIG_104_QUAD_8) += 104-quad-8.o
1010
obj-$(CONFIG_INTERRUPT_CNT) += interrupt-cnt.o
11+
obj-$(CONFIG_RZ_MTU3_CNT) += rz-mtu3-cnt.o
1112
obj-$(CONFIG_STM32_TIMER_CNT) += stm32-timer-cnt.o
1213
obj-$(CONFIG_STM32_LPTIMER_CNT) += stm32-lptimer-cnt.o
1314
obj-$(CONFIG_TI_EQEP) += ti-eqep.o

0 commit comments

Comments
 (0)