From: Rob Herring <robh@kernel.org>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: William Breathitt Gray <vilhelm.gray@gmail.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Pengutronix Kernel Team <kernel@pengutronix.de>,
David Jander <david@protonic.nl>,
Robin van der Gracht <robin@protonic.nl>,
linux-iio@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>,
Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH v5 1/2] dt-bindings: counter: add event-counter binding
Date: Wed, 10 Feb 2021 12:41:38 -0600 [thread overview]
Message-ID: <20210210184138.GA2504266@robh.at.kernel.org> (raw)
In-Reply-To: <20210208135347.18494-2-o.rempel@pengutronix.de>
On Mon, Feb 08, 2021 at 02:53:46PM +0100, Oleksij Rempel wrote:
> Add binding for the event counter node
>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
> .../bindings/counter/event-counter.yaml | 56 +++++++++++++++++++
> 1 file changed, 56 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/counter/event-counter.yaml
>
> diff --git a/Documentation/devicetree/bindings/counter/event-counter.yaml b/Documentation/devicetree/bindings/counter/event-counter.yaml
> new file mode 100644
> index 000000000000..bd05c1b38f20
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/counter/event-counter.yaml
> @@ -0,0 +1,56 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/counter/event-counter.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Event counter
> +
> +maintainers:
> + - Oleksij Rempel <o.rempel@pengutronix.de>
> +
> +description: |
> + A generic event counter to measure event frequency. It was developed and used
> + for agricultural devices to measure rotation speed of wheels or other tools.
> + Since the direction of rotation is not important, only one signal line is
> + needed.
> +
> +properties:
> + compatible:
> + const: event-counter
> +
> + interrupts:
> + maxItems: 1
> +
> + gpios:
> + description: Optional diagnostic interface to measure signal level
This description seems wrong in the case of only having a GPIO.
Also, a GPIO only implies polled mode because if the GPIO is interrupt
capable, 'interrupts' should be required. For gpio-keys, we split the
compatible strings in this case. I leave it to you if you want to make
it more explicit.
> + maxItems: 1
> +
> +required:
> + - compatible
anyOf:
- required: [ interrupts ]
- required: [ gpios ]
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> +
> + #include <dt-bindings/interrupt-controller/irq.h>
> + #include <dt-bindings/gpio/gpio.h>
> +
> + counter-0 {
> + compatible = "event-counter";
> + interrupts-extended = <&gpio 0 IRQ_TYPE_EDGE_RISING>;
> + };
> +
> + counter-1 {
> + compatible = "event-counter";
> + gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
> + };
> +
> + counter-2 {
> + compatible = "event-counter";
> + interrupts-extended = <&gpio 2 IRQ_TYPE_EDGE_RISING>;
> + gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
> + };
> +
> +...
> --
> 2.30.0
>
next prev parent reply other threads:[~2021-02-10 18:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 13:53 [PATCH v5 0/2] add support for GPIO or IRQ based evemt counter Oleksij Rempel
2021-02-08 13:53 ` [PATCH v5 1/2] dt-bindings: counter: add event-counter binding Oleksij Rempel
2021-02-10 18:41 ` Rob Herring [this message]
2021-02-12 9:22 ` Linus Walleij
2021-02-12 9:29 ` Linus Walleij
2021-02-08 13:53 ` [PATCH v5 2/2] counter: add IRQ or GPIO based event counter Oleksij Rempel
2021-02-08 14:14 ` William Breathitt Gray
2021-02-12 9:26 ` Linus Walleij
2021-02-15 7:58 ` Oleksij Rempel
2021-02-14 8:54 ` William Breathitt Gray
2021-02-15 9:17 ` Oleksij Rempel
2021-02-22 1:43 ` William Breathitt Gray
2021-02-23 10:06 ` Oleksij Rempel
2021-02-23 17:45 ` Oleksij Rempel
2021-02-24 2:34 ` William Breathitt Gray
2021-02-24 7:35 ` Oleksij Rempel
2021-02-24 8:11 ` William Breathitt Gray
2021-02-24 8:20 ` William Breathitt Gray
2021-02-26 6:46 ` Oleksij Rempel
2021-02-26 6:58 ` William Breathitt Gray
2021-03-02 15:37 ` Linus Walleij
2021-02-14 7:43 ` [PATCH v5 0/2] add support for GPIO or IRQ based evemt counter William Breathitt Gray
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210210184138.GA2504266@robh.at.kernel.org \
--to=robh@kernel.org \
--cc=david@protonic.nl \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=kernel@pengutronix.de \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=robin@protonic.nl \
--cc=vilhelm.gray@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.