Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/counter/interrupt-counter.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: Interrupt counter
0008 
0009 maintainers:
0010   - Oleksij Rempel <o.rempel@pengutronix.de>
0011 
0012 description: |
0013   A generic interrupt counter to measure interrupt frequency. It was developed
0014   and used for agricultural devices to measure rotation speed of wheels or
0015   other tools. Since the direction of rotation is not important, only one
0016   signal line is needed.
0017   Interrupts or gpios are required. If both are defined, the interrupt will
0018   take precedence for counting interrupts.
0019 
0020 properties:
0021   compatible:
0022     const: interrupt-counter
0023 
0024   interrupts:
0025     maxItems: 1
0026 
0027   gpios:
0028     maxItems: 1
0029 
0030 required:
0031   - compatible
0032 
0033 anyOf:
0034   - required: [ interrupts-extended ]
0035   - required: [ interrupts ]
0036   - required: [ gpios ]
0037 
0038 additionalProperties: false
0039 
0040 examples:
0041   - |
0042 
0043     #include <dt-bindings/interrupt-controller/irq.h>
0044     #include <dt-bindings/gpio/gpio.h>
0045 
0046     counter-0 {
0047         compatible = "interrupt-counter";
0048         interrupts-extended = <&gpio 0 IRQ_TYPE_EDGE_RISING>;
0049     };
0050 
0051     counter-1 {
0052         compatible = "interrupt-counter";
0053         gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
0054     };
0055 
0056     counter-2 {
0057         compatible = "interrupt-counter";
0058         interrupts-extended = <&gpio 2 IRQ_TYPE_EDGE_RISING>;
0059         gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
0060     };
0061 
0062 ...