st,stm32-lptimer.yaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/mfd/st,stm32-lptimer.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: STMicroelectronics STM32 Low-Power Timers
  7. description: |
  8. The STM32 Low-Power Timer (LPTIM) is a 16-bit timer that provides several
  9. functions
  10. - PWM output (with programmable prescaler, configurable polarity)
  11. - Trigger source for STM32 ADC/DAC (LPTIM_OUT)
  12. - Several counter modes:
  13. - quadrature encoder to detect angular position and direction of rotary
  14. elements, from IN1 and IN2 input signals.
  15. - simple counter from IN1 input signal.
  16. maintainers:
  17. - Fabrice Gasnier <fabrice.gasnier@foss.st.com>
  18. properties:
  19. compatible:
  20. const: st,stm32-lptimer
  21. reg:
  22. maxItems: 1
  23. clocks:
  24. maxItems: 1
  25. clock-names:
  26. items:
  27. - const: mux
  28. interrupts:
  29. maxItems: 1
  30. "#address-cells":
  31. const: 1
  32. "#size-cells":
  33. const: 0
  34. wakeup-source: true
  35. access-controllers:
  36. minItems: 1
  37. maxItems: 2
  38. pwm:
  39. type: object
  40. additionalProperties: false
  41. properties:
  42. compatible:
  43. const: st,stm32-pwm-lp
  44. "#pwm-cells":
  45. const: 3
  46. required:
  47. - "#pwm-cells"
  48. - compatible
  49. counter:
  50. type: object
  51. additionalProperties: false
  52. properties:
  53. compatible:
  54. const: st,stm32-lptimer-counter
  55. required:
  56. - compatible
  57. timer:
  58. type: object
  59. additionalProperties: false
  60. properties:
  61. compatible:
  62. const: st,stm32-lptimer-timer
  63. required:
  64. - compatible
  65. patternProperties:
  66. "^trigger@[0-9]+$":
  67. type: object
  68. additionalProperties: false
  69. properties:
  70. compatible:
  71. const: st,stm32-lptimer-trigger
  72. reg:
  73. description: Identify trigger hardware block.
  74. items:
  75. minimum: 0
  76. maximum: 2
  77. required:
  78. - compatible
  79. - reg
  80. required:
  81. - "#address-cells"
  82. - "#size-cells"
  83. - compatible
  84. - reg
  85. - clocks
  86. - clock-names
  87. additionalProperties: false
  88. examples:
  89. - |
  90. #include <dt-bindings/clock/stm32mp1-clks.h>
  91. #include <dt-bindings/interrupt-controller/arm-gic.h>
  92. timer@40002400 {
  93. compatible = "st,stm32-lptimer";
  94. reg = <0x40002400 0x400>;
  95. clocks = <&timer_clk>;
  96. clock-names = "mux";
  97. interrupts-extended = <&exti 47 IRQ_TYPE_LEVEL_HIGH>;
  98. #address-cells = <1>;
  99. #size-cells = <0>;
  100. pwm {
  101. compatible = "st,stm32-pwm-lp";
  102. #pwm-cells = <3>;
  103. };
  104. trigger@0 {
  105. compatible = "st,stm32-lptimer-trigger";
  106. reg = <0>;
  107. };
  108. counter {
  109. compatible = "st,stm32-lptimer-counter";
  110. };
  111. timer {
  112. compatible = "st,stm32-lptimer-timer";
  113. };
  114. };
  115. ...