Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1549135pxb; Wed, 10 Feb 2021 10:51:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPEydrMP6vynXAA6M1J/eWrEsDyM+D5sg5KWM5gfc3tl4Ry8RpAz6cKVi2ecK0IUQ0/nhL X-Received: by 2002:a05:6402:2694:: with SMTP id w20mr4559390edd.200.1612983110934; Wed, 10 Feb 2021 10:51:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612983110; cv=none; d=google.com; s=arc-20160816; b=aJdvSpEQwTCB3DpkI0oWhyKg5tVu+LICFHJZ2K7psUB5LVJtip/B+jvq8l3E9vyx1V XgumXleNxb7hLUGBhXgc9WFBLbOqfb9kk67rPKwKFjGiSdxnx2QxhxZeuHP/M3s7xDK9 d6hS7gcdPDrvPJvsLb3MPz6/4pm7zgp5sjrOA+MPkepS1GQAgOcelN4h1F3FJaAgfEWP eEiO0rFUpB2WlMLD0mzWwxz494zHp7OSlc6s3UK2YZA9MnmVhfHUX+g4QvKQqAdgVsWL h1iIAnAzRHsyIEJbJ3y4oNLnCfxnv2tyUwzf5QJIkKqWsMG2KZDG3c10N78Qoj4254Zq wrbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=JvRsBEYZg1OGL2h8YrNGcRIKhfQwRTmU700nenwBJCU=; b=R+1tEG/HA/Rjt9wvw1FEL/IfkG30Pq7SaHXBUVvLHyQ/IP6X8NUI7NtD1/iCoPnMaz PzzrnvveJyJPTCYzPE2TeLO0ioxRcXa7y/XSlUibXsmo4dUQJGanKHlRw7kX2xfJBw8D MPN4rDzs7NSR5nYzeoHsFwM1WFrpBKMAZo8uFxSpY9d49xT/9mwc2xpbJGxKAqXhJtpl kq183R743XQBo7xmIIOXVSAzRJkA3ShcyED9zHGMI1zU+KDP+D9tJy5ZaikeE//4DYZ8 W6ggmS0Ruul51hsB+buzcnwPNkdoQ8HWIfrNLK2lAlrNwpVJvklOybkiW+8cGTRZNQTi ySVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c70si1884963edf.551.2021.02.10.10.51.26; Wed, 10 Feb 2021 10:51:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233187AbhBJStz (ORCPT + 99 others); Wed, 10 Feb 2021 13:49:55 -0500 Received: from mail-oi1-f179.google.com ([209.85.167.179]:43861 "EHLO mail-oi1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234193AbhBJSmj (ORCPT ); Wed, 10 Feb 2021 13:42:39 -0500 Received: by mail-oi1-f179.google.com with SMTP id d20so3131668oiw.10; Wed, 10 Feb 2021 10:42:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JvRsBEYZg1OGL2h8YrNGcRIKhfQwRTmU700nenwBJCU=; b=uf7i3Eshy9nmmEOyIefUjfxJYoRUBAEefN6uMpB0kSP7Ynv+21cKgwt9C4n45x03nT JcBjd83wOVNyRGMthLbL7v96CmTEXQlYqold9hagjp/MYW9jmf8X4e3ioj8ruXLAvLx3 RUE86ymRjE0QjpIlXoeLkPTx47a4qAOtpUGS/I94CZDsCG85/jifaVnF9DKh1RIKfRH7 /Urd7B9U6Js3OKM/K/x3pOV9lL6qj5FKT5GMFu7CoW9YEQKDD6yALqpnz/kyieGuRZir VR5rMIK2awT85A2EBe8Pr/oqx8fBhYyMwSR/C6M8Tv078DqOeD4hawVgfubrNZ7Ex07P xnpQ== X-Gm-Message-State: AOAM530J+3Z1kkkXwmEcdtCwAyd/IewB8NqKv/RD0lh6ABo6InGd9z2c Omr6cMEByHk/jiR2SznKqg== X-Received: by 2002:aca:c704:: with SMTP id x4mr270547oif.24.1612982501184; Wed, 10 Feb 2021 10:41:41 -0800 (PST) Received: from robh.at.kernel.org (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id t19sm537508otr.64.2021.02.10.10.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 10:41:40 -0800 (PST) Received: (nullmailer pid 2516555 invoked by uid 1000); Wed, 10 Feb 2021 18:41:38 -0000 Date: Wed, 10 Feb 2021 12:41:38 -0600 From: Rob Herring To: Oleksij Rempel Cc: William Breathitt Gray , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Pengutronix Kernel Team , David Jander , Robin van der Gracht , linux-iio@vger.kernel.org, Linus Walleij , Jonathan Cameron Subject: Re: [PATCH v5 1/2] dt-bindings: counter: add event-counter binding Message-ID: <20210210184138.GA2504266@robh.at.kernel.org> References: <20210208135347.18494-1-o.rempel@pengutronix.de> <20210208135347.18494-2-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210208135347.18494-2-o.rempel@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > .../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 > + > +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 > + #include > + > + 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 >