xref: /linux/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml (revision 7255fcc80d4b525cc10cfaaf7f485830d4ed2000)
1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/thermal/allwinner,sun8i-a83t-ths.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Allwinner SUN8I Thermal Controller
8
9maintainers:
10  - Vasily Khoruzhick <anarsoul@gmail.com>
11  - Yangtao Li <tiny.windzz@gmail.com>
12
13properties:
14  compatible:
15    enum:
16      - allwinner,sun8i-a83t-ths
17      - allwinner,sun8i-h3-ths
18      - allwinner,sun8i-r40-ths
19      - allwinner,sun20i-d1-ths
20      - allwinner,sun50i-a64-ths
21      - allwinner,sun50i-a100-ths
22      - allwinner,sun50i-h5-ths
23      - allwinner,sun50i-h6-ths
24      - allwinner,sun50i-h616-ths
25
26  clocks:
27    minItems: 1
28    items:
29      - description: Bus Clock
30      - description: Module Clock
31
32  clock-names:
33    minItems: 1
34    items:
35      - const: bus
36      - const: mod
37
38  reg:
39    maxItems: 1
40
41  interrupts:
42    maxItems: 1
43
44  resets:
45    maxItems: 1
46
47  nvmem-cells:
48    maxItems: 1
49    description: Calibration data for thermal sensors
50
51  nvmem-cell-names:
52    const: calibration
53
54  allwinner,sram:
55    maxItems: 1
56    description: phandle to device controlling temperate offset SYS_CFG register
57
58  # See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for details
59  "#thermal-sensor-cells":
60    enum:
61      - 0
62      - 1
63
64allOf:
65  - if:
66      properties:
67        compatible:
68          contains:
69            enum:
70              - allwinner,sun20i-d1-ths
71              - allwinner,sun50i-a100-ths
72              - allwinner,sun50i-h6-ths
73              - allwinner,sun50i-h616-ths
74
75    then:
76      properties:
77        clocks:
78          maxItems: 1
79
80        clock-names:
81          maxItems: 1
82
83    else:
84      properties:
85        clocks:
86          minItems: 2
87
88        clock-names:
89          minItems: 2
90
91  - if:
92      not:
93        properties:
94          compatible:
95            contains:
96              const: allwinner,sun50i-h616-ths
97
98    then:
99      properties:
100        allwinner,sram: false
101
102  - if:
103      properties:
104        compatible:
105          contains:
106            enum:
107              - allwinner,sun8i-h3-ths
108              - allwinner,sun20i-d1-ths
109
110    then:
111      properties:
112        "#thermal-sensor-cells":
113          const: 0
114
115    else:
116      properties:
117        "#thermal-sensor-cells":
118          const: 1
119
120  - if:
121      not:
122        properties:
123          compatible:
124            contains:
125              enum:
126                - allwinner,sun8i-a83t-ths
127
128    then:
129      required:
130        - clocks
131        - clock-names
132        - resets
133
134required:
135  - compatible
136  - reg
137  - interrupts
138  - '#thermal-sensor-cells'
139
140additionalProperties: false
141
142examples:
143  - |
144    thermal-sensor@1f04000 {
145         compatible = "allwinner,sun8i-a83t-ths";
146         reg = <0x01f04000 0x100>;
147         interrupts = <0 31 0>;
148         nvmem-cells = <&ths_calibration>;
149         nvmem-cell-names = "calibration";
150         #thermal-sensor-cells = <1>;
151    };
152
153  - |
154    thermal-sensor@1c25000 {
155         compatible = "allwinner,sun8i-h3-ths";
156         reg = <0x01c25000 0x400>;
157         clocks = <&ccu 0>, <&ccu 1>;
158         clock-names = "bus", "mod";
159         resets = <&ccu 2>;
160         interrupts = <0 31 0>;
161         nvmem-cells = <&ths_calibration>;
162         nvmem-cell-names = "calibration";
163         #thermal-sensor-cells = <0>;
164    };
165
166  - |
167    thermal-sensor@5070400 {
168         compatible = "allwinner,sun50i-h6-ths";
169         reg = <0x05070400 0x100>;
170         clocks = <&ccu 0>;
171         clock-names = "bus";
172         resets = <&ccu 2>;
173         interrupts = <0 15 0>;
174         nvmem-cells = <&ths_calibration>;
175         nvmem-cell-names = "calibration";
176         #thermal-sensor-cells = <1>;
177    };
178
179...
180