Re: [PATCH v7 1/3] dt-bindings: counter: add gpio-counter binding

From: Rob Herring

Date: Wed Jul 22 2026 - 11:42:40 EST


On Tue, Jul 14, 2026 at 10:17:07AM +0200, Wadim Mueller wrote:
> Add a binding for a generic GPIO-based counter. Two GPIOs (signal-a,
> signal-b) drive two Counts; optional index GPIOs load a preset. The
> counter function (quadrature, pulse-direction, increase/decrease) is
> selected at runtime via the counter sysfs interface.
>
> Signed-off-by: Wadim Mueller <wafgo01@xxxxxxxxx>
> ---
> v7:
> - index-gpios split into seperate index1-gpios/index2-gpios, so
> Count 2 can have an index line without a dummy entry for Count 1
> - dropped Conors Ack since the binding changed
> ---
> .../bindings/counter/gpio-counter.yaml | 60 +++++++++++++++++++
> 1 file changed, 60 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/counter/gpio-counter.yaml
>
> diff --git a/Documentation/devicetree/bindings/counter/gpio-counter.yaml b/Documentation/devicetree/bindings/counter/gpio-counter.yaml
> new file mode 100644
> index 000000000000..782cb177ed0b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/counter/gpio-counter.yaml
> @@ -0,0 +1,60 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/counter/gpio-counter.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: GPIO-based Counter
> +
> +maintainers:
> + - Wadim Mueller <wafgo01@xxxxxxxxx>
> +
> +description: |
> + GPIO-based software counter with two Counts:
> + * Count 1: A + B. Quadrature X1/X2/X4, pulse-direction, inc/dec.
> + * Count 2: B. Inc / dec.
> + The function is selected at runtime via the counter sysfs ABI. Each

sysfs is not relevant to bindings.

> + Count has an optional Index (Z) that loads its preset on rising edge.

I don't have any clue what this h/w is based on *this* patch. Rotary
encoder was mentioned elsewhere, but this patch needs to stand on its
own. We already have rotary encoder and GPIO decoder bindings. How is
this h/w different? The patch needs to answer that.

Rob