Documentation/devicetree/bindings/counter/interrupt-counter.yaml

Source file repositories/reference/linux-study-clean/Documentation/devicetree/bindings/counter/interrupt-counter.yaml

File Facts

System
Linux kernel
Corpus path
Documentation/devicetree/bindings/counter/interrupt-counter.yaml
Extension
.yaml
Size
1437 bytes
Lines
63
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: configuration, schema, or hardware description
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

# 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>;
    };

...

Annotation

Implementation Notes