Linux 6.9-rc1
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / thermal / rcar-gen3-thermal.yaml
1 # SPDX-License-Identifier: GPL-2.0-only
2 # Copyright (C) 2020 Renesas Electronics Corp.
3 %YAML 1.2
4 ---
5 $id: http://devicetree.org/schemas/thermal/rcar-gen3-thermal.yaml#
6 $schema: http://devicetree.org/meta-schemas/core.yaml#
7
8 title: Renesas R-Car Gen3 Thermal Sensor
9
10 description:
11   On most R-Car Gen3 and later SoCs, the thermal sensor controllers (TSC)
12   control the thermal sensors (THS) which are the analog circuits for
13   measuring temperature (Tj) inside the LSI.
14
15 maintainers:
16   - Niklas Söderlund <niklas.soderlund@ragnatech.se>
17
18 properties:
19   compatible:
20     enum:
21       - renesas,r8a774a1-thermal # RZ/G2M
22       - renesas,r8a774b1-thermal # RZ/G2N
23       - renesas,r8a774e1-thermal # RZ/G2H
24       - renesas,r8a7795-thermal  # R-Car H3
25       - renesas,r8a7796-thermal  # R-Car M3-W
26       - renesas,r8a77961-thermal # R-Car M3-W+
27       - renesas,r8a77965-thermal # R-Car M3-N
28       - renesas,r8a77980-thermal # R-Car V3H
29       - renesas,r8a779a0-thermal # R-Car V3U
30       - renesas,r8a779f0-thermal # R-Car S4-8
31       - renesas,r8a779g0-thermal # R-Car V4H
32       - renesas,r8a779h0-thermal # R-Car V4M
33
34   reg: true
35
36   interrupts:
37     items:
38       - description: TEMP1 interrupt
39       - description: TEMP2 interrupt
40       - description: TEMP3 interrupt
41
42   clocks:
43     maxItems: 1
44
45   power-domains:
46     maxItems: 1
47
48   resets:
49     maxItems: 1
50
51   "#thermal-sensor-cells":
52     const: 1
53
54 required:
55   - compatible
56   - reg
57   - clocks
58   - power-domains
59   - resets
60   - "#thermal-sensor-cells"
61
62 if:
63   properties:
64     compatible:
65       contains:
66         enum:
67           - renesas,r8a779a0-thermal
68 then:
69   properties:
70     reg:
71       items:
72         - description: TSC0 registers
73         - description: TSC1 registers
74         - description: TSC2 registers
75         - description: TSC3 registers
76         - description: TSC4 registers
77 else:
78   properties:
79     reg:
80       minItems: 2
81       items:
82         - description: TSC1 registers
83         - description: TSC2 registers
84         - description: TSC3 registers
85         - description: TSC4 registers
86   if:
87     not:
88       properties:
89         compatible:
90           contains:
91             enum:
92               - renesas,r8a779f0-thermal
93               - renesas,r8a779g0-thermal
94               - renesas,r8a779h0-thermal
95   then:
96     required:
97       - interrupts
98
99 additionalProperties: false
100
101 examples:
102   - |
103     #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
104     #include <dt-bindings/interrupt-controller/arm-gic.h>
105     #include <dt-bindings/power/r8a7795-sysc.h>
106
107     tsc: thermal@e6198000 {
108             compatible = "renesas,r8a7795-thermal";
109             reg = <0xe6198000 0x100>,
110                   <0xe61a0000 0x100>,
111                   <0xe61a8000 0x100>;
112             interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
113                          <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
114                          <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
115             clocks = <&cpg CPG_MOD 522>;
116             power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
117             resets = <&cpg 522>;
118             #thermal-sensor-cells = <1>;
119     };
120
121     thermal-zones {
122             sensor_thermal: sensor-thermal {
123                     polling-delay-passive = <250>;
124                     polling-delay = <1000>;
125                     thermal-sensors = <&tsc 0>;
126
127                     trips {
128                             sensor1_crit: sensor1-crit {
129                                     temperature = <90000>;
130                                     hysteresis = <2000>;
131                                     type = "critical";
132                             };
133                     };
134             };
135     };
136   - |
137     #include <dt-bindings/clock/r8a779a0-cpg-mssr.h>
138     #include <dt-bindings/interrupt-controller/arm-gic.h>
139     #include <dt-bindings/power/r8a779a0-sysc.h>
140
141     tsc_r8a779a0: thermal@e6190000 {
142             compatible = "renesas,r8a779a0-thermal";
143             reg = <0xe6190000 0x200>,
144                   <0xe6198000 0x200>,
145                   <0xe61a0000 0x200>,
146                   <0xe61a8000 0x200>,
147                   <0xe61b0000 0x200>;
148             clocks = <&cpg CPG_MOD 919>;
149             power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
150             resets = <&cpg 919>;
151             #thermal-sensor-cells = <1>;
152     };