public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] counter: add GPIO-based quadrature encoder driver
@ 2026-04-16 20:48 Wadim Mueller
  2026-04-16 20:48 ` [PATCH 1/3] dt-bindings: counter: add gpio-quadrature-encoder binding Wadim Mueller
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Wadim Mueller @ 2026-04-16 20:48 UTC (permalink / raw)
  To: wbg
  Cc: robh, krzk+dt, conor+dt, linux-iio, devicetree, linux-kernel,
	Wadim Mueller

This series adds a new counter subsystem driver that implements
quadrature encoder position tracking using plain GPIO pins with
edge-triggered interrupts.

The driver is intended for low to medium speed rotary encoders where
hardware counter peripherals (eQEP, FTM, etc.) are unavailable or
already in use.  It targets the same use-cases as interrupt-cnt.c but
provides full quadrature decoding instead of simple pulse counting.

Features:
  - X1, X2, X4 quadrature decoding and pulse-direction mode
  - Optional index signal for zero-reset
  - Configurable ceiling (position clamping)
  - Standard counter subsystem sysfs + chrdev interface
  - Enable/disable via sysfs with IRQ gating

Tested on TI AM64x (Cortex-A53) with a motor-driven rotary encoder
at up to 2 kHz quadrature edge rate.

Wadim Mueller (3):
  dt-bindings: counter: add gpio-quadrature-encoder binding
  counter: add GPIO-based quadrature encoder driver
  MAINTAINERS: add entry for GPIO quadrature encoder counter driver

 .../counter/gpio-quadrature-encoder.yaml      |  69 ++
 MAINTAINERS                                   |   7 +
 drivers/counter/Kconfig                       |  15 +
 drivers/counter/Makefile                      |   1 +
 drivers/counter/gpio-quadrature-encoder.c     | 710 ++++++++++++++++++
 5 files changed, 802 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/counter/gpio-quadrature-encoder.yaml
 create mode 100644 drivers/counter/gpio-quadrature-encoder.c

-- 
2.52.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-17 16:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-16 20:48 [PATCH 0/3] counter: add GPIO-based quadrature encoder driver Wadim Mueller
2026-04-16 20:48 ` [PATCH 1/3] dt-bindings: counter: add gpio-quadrature-encoder binding Wadim Mueller
2026-04-17 16:13   ` Conor Dooley
2026-04-16 20:48 ` [PATCH 2/3] counter: add GPIO-based quadrature encoder driver Wadim Mueller
2026-04-16 20:48 ` [PATCH 3/3] MAINTAINERS: add entry for GPIO quadrature encoder counter driver Wadim Mueller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox