Path: blob/master/Documentation/devicetree/bindings/counter/interrupt-counter.yaml
26308 views
# SPDX-License-Identifier: GPL-2.01%YAML 1.22---3$id: http://devicetree.org/schemas/counter/interrupt-counter.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: Interrupt counter78maintainers:9- Oleksij Rempel <o.rempel@pengutronix.de>1011description: |12A generic interrupt counter to measure interrupt frequency. It was developed13and used for agricultural devices to measure rotation speed of wheels or14other tools. Since the direction of rotation is not important, only one15signal line is needed.16Interrupts or gpios are required. If both are defined, the interrupt will17take precedence for counting interrupts.1819properties:20compatible:21const: interrupt-counter2223interrupts:24maxItems: 12526gpios:27maxItems: 12829required:30- compatible3132anyOf:33- required: [ interrupts-extended ]34- required: [ interrupts ]35- required: [ gpios ]3637additionalProperties: false3839examples:40- |4142#include <dt-bindings/interrupt-controller/irq.h>43#include <dt-bindings/gpio/gpio.h>4445counter-0 {46compatible = "interrupt-counter";47interrupts-extended = <&gpio 0 IRQ_TYPE_EDGE_RISING>;48};4950counter-1 {51compatible = "interrupt-counter";52gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;53};5455counter-2 {56compatible = "interrupt-counter";57interrupts-extended = <&gpio 2 IRQ_TYPE_EDGE_RISING>;58gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;59};6061...626364