Commit 0b8061c3 authored by Oleksij Rempel's avatar Oleksij Rempel Committed by Jonathan Cameron

dt-bindings: counter: add interrupt-counter binding

Add binding for the interrupt counter node
Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210301080401.22190-2-o.rempel@pengutronix.deSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent b627e3b5
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/counter/interrupt-counter.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Interrupt counter
maintainers:
- Oleksij Rempel <o.rempel@pengutronix.de>
description: |
A generic interrupt counter to measure interrupt 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.
Interrupts or gpios are required. If both are defined, the interrupt will
take precedence for counting interrupts.
properties:
compatible:
const: interrupt-counter
interrupts:
maxItems: 1
gpios:
maxItems: 1
required:
- compatible
anyOf:
- required: [ interrupts-extended ]
- required: [ interrupts ]
- required: [ gpios ]
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
counter-0 {
compatible = "interrupt-counter";
interrupts-extended = <&gpio 0 IRQ_TYPE_EDGE_RISING>;
};
counter-1 {
compatible = "interrupt-counter";
gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
};
counter-2 {
compatible = "interrupt-counter";
interrupts-extended = <&gpio 2 IRQ_TYPE_EDGE_RISING>;
gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
};
...
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment