Generic Counter subsystem for quadrature encoders and timer/counter IP
A kernel framework that exposes hardware counters — typically quadrature encoders for motor shaft position, plus general pulse and event counters — through a uniform userspace interface. It is used in industrial control, motion systems, and embedded automation, backing counter peripherals in modern SoCs and microcontrollers as well as older PC-based DAQ cards.
recommendation
It should stay because this is a live kernel subsystem, not a single legacy driver, and it underpins counter and quadrature-encoder hardware in current SoCs from STMicro (STM32MP13/15/21/23/25 LPTIMER), Renesas (RZ/G2L MTU3, marketed with availability through 2037), TI, Microchip, and Intel, plus older ACCES industrial cards. Upstream activity is recent — a refcount-leak fix landed in April 2026 with normal review traffic — and there is no replacement framework on the horizon.
repository signals
sources
- lore.kernel.org
The subsystem saw a non-mechanical bug-fix patch in April 2026 ('counter: Fix refcount leak in counter_alloc() error path'), showing current upstream maintenance.
- lore.kernel.org
There was active review/revision traffic for the same counter-core fix in April 2026, indicating ongoing maintainer and reviewer attention rather than abandonment.
- renesas.com
Renesas still marketed the RZ/G2L as an active product with longevity through 2037, and this tree contains the matching `rz-mtu3-cnt` driver for that SoC family.
- st.com
ST lists STM32 low-power timer software as active/in volume production, matching the STM32 LPTIMER counter support in this directory.
- wiki.st.com
ST's 2025 STM32 MPU documentation describes current Linux Counter subsystem usage on STM32MP13x/15x/21x/23x/25x lines, evidence of present-day deployments.
codex reasoning notes (technical)
`drivers/counter` is an actively maintained driver subsystem, not an obsolete single-device driver. Lore evidence came from `lore_file_timeline` on `drivers/counter/counter-core.c`; it showed recent 2026 fixes and no removal signal. A removal-focused `lore_regex` query timed out rather than finding hits, so there is no positive removal evidence. Local tree inspection via shell showed maintained Kconfig entries for current STM32, TI, Renesas, Microchip, Intel QEP, and legacy ACCES hardware. Deployment evidence came from web search results on vendor/official docs pages (Renesas active RZ/G2L, ST active LPTIMER package, ST 2025 Counter overview). Because the directory serves current industrial/embedded timer/counter IP still shipping in new SoCs, the right outcome is `keep`, with no natural replacement driver for the subsystem as a whole.