summaryrefslogtreecommitdiffstats
path: root/dts/Bindings/counter/interrupt-counter.yaml
blob: fd075d104631015dc54da18ff0f59836e7366b40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 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>;
    };

...