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 Device Tree Bindings
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,sun50i-a64-ths
20      - allwinner,sun50i-a100-ths
21      - allwinner,sun50i-h5-ths
22      - allwinner,sun50i-h6-ths
23
24  clocks:
25    minItems: 1
26    maxItems: 2
27    items:
28      - description: Bus Clock
29      - description: Module Clock
30
31  clock-names:
32    minItems: 1
33    maxItems: 2
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  # See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for details
55  "#thermal-sensor-cells":
56    enum:
57      - 0
58      - 1
59
60allOf:
61  - if:
62      properties:
63        compatible:
64          contains:
65            enum:
66              - allwinner,sun50i-a100-ths
67              - allwinner,sun50i-h6-ths
68
69    then:
70      properties:
71        clocks:
72          maxItems: 1
73
74        clock-names:
75          maxItems: 1
76
77    else:
78      properties:
79        clocks:
80          minItems: 2
81
82        clock-names:
83          minItems: 2
84
85  - if:
86      properties:
87        compatible:
88          contains:
89            const: allwinner,sun8i-h3-ths
90
91    then:
92      properties:
93        "#thermal-sensor-cells":
94          const: 0
95
96    else:
97      properties:
98        "#thermal-sensor-cells":
99          const: 1
100
101  - if:
102      properties:
103        compatible:
104          contains:
105            enum:
106              - allwinner,sun8i-h3-ths
107              - allwinner,sun8i-r40-ths
108              - allwinner,sun50i-a64-ths
109              - allwinner,sun50i-a100-ths
110              - allwinner,sun50i-h5-ths
111              - allwinner,sun50i-h6-ths
112
113    then:
114      required:
115        - clocks
116        - clock-names
117        - resets
118
119required:
120  - compatible
121  - reg
122  - interrupts
123  - '#thermal-sensor-cells'
124
125additionalProperties: false
126
127examples:
128  - |
129    thermal-sensor@1f04000 {
130         compatible = "allwinner,sun8i-a83t-ths";
131         reg = <0x01f04000 0x100>;
132         interrupts = <0 31 0>;
133         nvmem-cells = <&ths_calibration>;
134         nvmem-cell-names = "calibration";
135         #thermal-sensor-cells = <1>;
136    };
137
138  - |
139    thermal-sensor@1c25000 {
140         compatible = "allwinner,sun8i-h3-ths";
141         reg = <0x01c25000 0x400>;
142         clocks = <&ccu 0>, <&ccu 1>;
143         clock-names = "bus", "mod";
144         resets = <&ccu 2>;
145         interrupts = <0 31 0>;
146         nvmem-cells = <&ths_calibration>;
147         nvmem-cell-names = "calibration";
148         #thermal-sensor-cells = <0>;
149    };
150
151  - |
152    thermal-sensor@5070400 {
153         compatible = "allwinner,sun50i-h6-ths";
154         reg = <0x05070400 0x100>;
155         clocks = <&ccu 0>;
156         clock-names = "bus";
157         resets = <&ccu 2>;
158         interrupts = <0 15 0>;
159         nvmem-cells = <&ths_calibration>;
160         nvmem-cell-names = "calibration";
161         #thermal-sensor-cells = <1>;
162    };
163
164...
165