xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/st,stm32-lptimer.yaml (revision 8bab661a3316d8bd9b9fbd11a3b4371b91507bd2)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/mfd/st,stm32-lptimer.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7*8bab661aSEmmanuel Vadottitle: STMicroelectronics STM32 Low-Power Timers
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotdescription: |
10c66ec88fSEmmanuel Vadot  The STM32 Low-Power Timer (LPTIM) is a 16-bit timer that provides several
11c66ec88fSEmmanuel Vadot  functions
12c66ec88fSEmmanuel Vadot   - PWM output (with programmable prescaler, configurable polarity)
13c66ec88fSEmmanuel Vadot   - Trigger source for STM32 ADC/DAC (LPTIM_OUT)
14c66ec88fSEmmanuel Vadot   - Several counter modes:
15c66ec88fSEmmanuel Vadot     - quadrature encoder to detect angular position and direction of rotary
16c66ec88fSEmmanuel Vadot       elements, from IN1 and IN2 input signals.
17c66ec88fSEmmanuel Vadot     - simple counter from IN1 input signal.
18c66ec88fSEmmanuel Vadot
19c66ec88fSEmmanuel Vadotmaintainers:
208cc087a1SEmmanuel Vadot  - Fabrice Gasnier <fabrice.gasnier@foss.st.com>
21c66ec88fSEmmanuel Vadot
22c66ec88fSEmmanuel Vadotproperties:
23c66ec88fSEmmanuel Vadot  compatible:
24c66ec88fSEmmanuel Vadot    const: st,stm32-lptimer
25c66ec88fSEmmanuel Vadot
26c66ec88fSEmmanuel Vadot  reg:
27c66ec88fSEmmanuel Vadot    maxItems: 1
28c66ec88fSEmmanuel Vadot
29c66ec88fSEmmanuel Vadot  clocks:
30c66ec88fSEmmanuel Vadot    maxItems: 1
31c66ec88fSEmmanuel Vadot
32c66ec88fSEmmanuel Vadot  clock-names:
33c66ec88fSEmmanuel Vadot    items:
34c66ec88fSEmmanuel Vadot      - const: mux
35c66ec88fSEmmanuel Vadot
36c66ec88fSEmmanuel Vadot  interrupts:
37c66ec88fSEmmanuel Vadot    maxItems: 1
38c66ec88fSEmmanuel Vadot
39c66ec88fSEmmanuel Vadot  "#address-cells":
40c66ec88fSEmmanuel Vadot    const: 1
41c66ec88fSEmmanuel Vadot
42c66ec88fSEmmanuel Vadot  "#size-cells":
43c66ec88fSEmmanuel Vadot    const: 0
44c66ec88fSEmmanuel Vadot
45c66ec88fSEmmanuel Vadot  wakeup-source: true
46c66ec88fSEmmanuel Vadot
47c66ec88fSEmmanuel Vadot  pwm:
48c66ec88fSEmmanuel Vadot    type: object
497ef62cebSEmmanuel Vadot    additionalProperties: false
50c66ec88fSEmmanuel Vadot
51c66ec88fSEmmanuel Vadot    properties:
52c66ec88fSEmmanuel Vadot      compatible:
53c66ec88fSEmmanuel Vadot        const: st,stm32-pwm-lp
54c66ec88fSEmmanuel Vadot
55c66ec88fSEmmanuel Vadot      "#pwm-cells":
56c66ec88fSEmmanuel Vadot        const: 3
57c66ec88fSEmmanuel Vadot
58c66ec88fSEmmanuel Vadot    required:
59c66ec88fSEmmanuel Vadot      - "#pwm-cells"
60c66ec88fSEmmanuel Vadot      - compatible
61c66ec88fSEmmanuel Vadot
62c66ec88fSEmmanuel Vadot  counter:
63c66ec88fSEmmanuel Vadot    type: object
647ef62cebSEmmanuel Vadot    additionalProperties: false
65c66ec88fSEmmanuel Vadot
66c66ec88fSEmmanuel Vadot    properties:
67c66ec88fSEmmanuel Vadot      compatible:
68c66ec88fSEmmanuel Vadot        const: st,stm32-lptimer-counter
69c66ec88fSEmmanuel Vadot
70c66ec88fSEmmanuel Vadot    required:
71c66ec88fSEmmanuel Vadot      - compatible
72c66ec88fSEmmanuel Vadot
73c66ec88fSEmmanuel Vadot  timer:
74c66ec88fSEmmanuel Vadot    type: object
757ef62cebSEmmanuel Vadot    additionalProperties: false
76c66ec88fSEmmanuel Vadot
77c66ec88fSEmmanuel Vadot    properties:
78c66ec88fSEmmanuel Vadot      compatible:
79c66ec88fSEmmanuel Vadot        const: st,stm32-lptimer-timer
80c66ec88fSEmmanuel Vadot
81c66ec88fSEmmanuel Vadot    required:
82c66ec88fSEmmanuel Vadot      - compatible
83c66ec88fSEmmanuel Vadot
84b97ee269SEmmanuel VadotpatternProperties:
85b97ee269SEmmanuel Vadot  "^trigger@[0-9]+$":
86b97ee269SEmmanuel Vadot    type: object
877ef62cebSEmmanuel Vadot    additionalProperties: false
88b97ee269SEmmanuel Vadot
89b97ee269SEmmanuel Vadot    properties:
90b97ee269SEmmanuel Vadot      compatible:
91b97ee269SEmmanuel Vadot        const: st,stm32-lptimer-trigger
92b97ee269SEmmanuel Vadot
93b97ee269SEmmanuel Vadot      reg:
94b97ee269SEmmanuel Vadot        description: Identify trigger hardware block.
95b97ee269SEmmanuel Vadot        items:
96b97ee269SEmmanuel Vadot          minimum: 0
97b97ee269SEmmanuel Vadot          maximum: 2
98b97ee269SEmmanuel Vadot
99b97ee269SEmmanuel Vadot    required:
100b97ee269SEmmanuel Vadot      - compatible
101b97ee269SEmmanuel Vadot      - reg
102b97ee269SEmmanuel Vadot
103c66ec88fSEmmanuel Vadotrequired:
104c66ec88fSEmmanuel Vadot  - "#address-cells"
105c66ec88fSEmmanuel Vadot  - "#size-cells"
106c66ec88fSEmmanuel Vadot  - compatible
107c66ec88fSEmmanuel Vadot  - reg
108c66ec88fSEmmanuel Vadot  - clocks
109c66ec88fSEmmanuel Vadot  - clock-names
110c66ec88fSEmmanuel Vadot
111c66ec88fSEmmanuel VadotadditionalProperties: false
112c66ec88fSEmmanuel Vadot
113c66ec88fSEmmanuel Vadotexamples:
114c66ec88fSEmmanuel Vadot  - |
115c66ec88fSEmmanuel Vadot    #include <dt-bindings/clock/stm32mp1-clks.h>
116c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
117c66ec88fSEmmanuel Vadot    timer@40002400 {
118c66ec88fSEmmanuel Vadot      compatible = "st,stm32-lptimer";
119c66ec88fSEmmanuel Vadot      reg = <0x40002400 0x400>;
120c66ec88fSEmmanuel Vadot      clocks = <&timer_clk>;
121c66ec88fSEmmanuel Vadot      clock-names = "mux";
122c66ec88fSEmmanuel Vadot      interrupts-extended = <&exti 47 IRQ_TYPE_LEVEL_HIGH>;
123c66ec88fSEmmanuel Vadot      #address-cells = <1>;
124c66ec88fSEmmanuel Vadot      #size-cells = <0>;
125c66ec88fSEmmanuel Vadot
126c66ec88fSEmmanuel Vadot      pwm {
127c66ec88fSEmmanuel Vadot        compatible = "st,stm32-pwm-lp";
128c66ec88fSEmmanuel Vadot        #pwm-cells = <3>;
129c66ec88fSEmmanuel Vadot      };
130c66ec88fSEmmanuel Vadot
131c66ec88fSEmmanuel Vadot      trigger@0 {
132c66ec88fSEmmanuel Vadot        compatible = "st,stm32-lptimer-trigger";
133c66ec88fSEmmanuel Vadot        reg = <0>;
134c66ec88fSEmmanuel Vadot      };
135c66ec88fSEmmanuel Vadot
136c66ec88fSEmmanuel Vadot      counter {
137c66ec88fSEmmanuel Vadot        compatible = "st,stm32-lptimer-counter";
138c66ec88fSEmmanuel Vadot      };
139c66ec88fSEmmanuel Vadot
140c66ec88fSEmmanuel Vadot      timer {
141c66ec88fSEmmanuel Vadot        compatible = "st,stm32-lptimer-timer";
142c66ec88fSEmmanuel Vadot      };
143c66ec88fSEmmanuel Vadot    };
144c66ec88fSEmmanuel Vadot
145c66ec88fSEmmanuel Vadot...
146