Interrupt counter

Schema identifier ($id): "http://devicetree.org/schemas/counter/interrupt-counter.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Oleksij Rempel <o.rempel@pengutronix.de>"

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 and child nodes (properties) #

compatible — required here #

Exact value (const): "interrupt-counter"

interrupts — not listed as required here #

Maximum number of items (maxItems): 1

gpios — not listed as required here #

Maximum number of items (maxItems): 1

Required in this object (required): "compatible"

At least one of these rules must match (anyOf) #

Rule 1 #

Required in this object (required): "interrupts-extended"

Rule 2 #

Required in this object (required): "interrupts"

Rule 3 #

Required in this object (required): "gpios"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Examples (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>;
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: GPL-2.0

Edit this page