interrupt-counter.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # SPDX-License-Identifier: GPL-2.0
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/counter/interrupt-counter.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Interrupt counter
  7. maintainers:
  8. - Oleksij Rempel <o.rempel@pengutronix.de>
  9. description: |
  10. A generic interrupt counter to measure interrupt frequency. It was developed
  11. and used for agricultural devices to measure rotation speed of wheels or
  12. other tools. Since the direction of rotation is not important, only one
  13. signal line is needed.
  14. Interrupts or gpios are required. If both are defined, the interrupt will
  15. take precedence for counting interrupts.
  16. properties:
  17. compatible:
  18. const: interrupt-counter
  19. interrupts:
  20. maxItems: 1
  21. gpios:
  22. maxItems: 1
  23. required:
  24. - compatible
  25. anyOf:
  26. - required: [ interrupts-extended ]
  27. - required: [ interrupts ]
  28. - required: [ gpios ]
  29. additionalProperties: false
  30. examples:
  31. - |
  32. #include <dt-bindings/interrupt-controller/irq.h>
  33. #include <dt-bindings/gpio/gpio.h>
  34. counter-0 {
  35. compatible = "interrupt-counter";
  36. interrupts-extended = <&gpio 0 IRQ_TYPE_EDGE_RISING>;
  37. };
  38. counter-1 {
  39. compatible = "interrupt-counter";
  40. gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
  41. };
  42. counter-2 {
  43. compatible = "interrupt-counter";
  44. interrupts-extended = <&gpio 2 IRQ_TYPE_EDGE_RISING>;
  45. gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
  46. };
  47. ...