treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / Documentation / devicetree / bindings / thermal / allwinner,sun8i-a83t-ths.yaml
blob87369264feb96fcac3ef48ec0613e9730175cabc
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#
7 title: Allwinner SUN8I Thermal Controller Device Tree Bindings
9 maintainers:
10   - Vasily Khoruzhick <anarsoul@gmail.com>
11   - Yangtao Li <tiny.windzz@gmail.com>
13 properties:
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-h5-ths
21       - allwinner,sun50i-h6-ths
23   clocks:
24     minItems: 1
25     maxItems: 2
26     items:
27       - description: Bus Clock
28       - description: Module Clock
30   clock-names:
31     minItems: 1
32     maxItems: 2
33     items:
34       - const: bus
35       - const: mod
37   reg:
38     maxItems: 1
40   interrupts:
41     maxItems: 1
43   resets:
44     maxItems: 1
46   nvmem-cells:
47     maxItems: 1
48     description: Calibration data for thermal sensors
50   nvmem-cell-names:
51     const: calibration
53   # See ./thermal.txt for details
54   "#thermal-sensor-cells":
55     enum:
56       - 0
57       - 1
59 allOf:
60   - if:
61       properties:
62         compatible:
63           contains:
64             const: allwinner,sun50i-h6-ths
66     then:
67       properties:
68         clocks:
69           maxItems: 1
71         clock-names:
72           maxItems: 1
74     else:
75       properties:
76         clocks:
77           minItems: 2
79         clock-names:
80           minItems: 2
82   - if:
83       properties:
84         compatible:
85           contains:
86             const: allwinner,sun8i-h3-ths
88     then:
89       properties:
90         "#thermal-sensor-cells":
91           const: 0
93     else:
94       properties:
95         "#thermal-sensor-cells":
96           const: 1
98   - if:
99       properties:
100         compatible:
101           contains:
102             enum:
103               - const: allwinner,sun8i-h3-ths
104               - const: allwinner,sun8i-r40-ths
105               - const: allwinner,sun50i-a64-ths
106               - const: allwinner,sun50i-h5-ths
107               - const: allwinner,sun50i-h6-ths
109     then:
110       required:
111         - clocks
112         - clock-names
113         - resets
115 required:
116   - compatible
117   - reg
118   - interrupts
119   - '#thermal-sensor-cells'
121 additionalProperties: false
123 examples:
124   - |
125     thermal-sensor@1f04000 {
126          compatible = "allwinner,sun8i-a83t-ths";
127          reg = <0x01f04000 0x100>;
128          interrupts = <0 31 0>;
129          nvmem-cells = <&ths_calibration>;
130          nvmem-cell-names = "calibration";
131          #thermal-sensor-cells = <1>;
132     };
134   - |
135     thermal-sensor@1c25000 {
136          compatible = "allwinner,sun8i-h3-ths";
137          reg = <0x01c25000 0x400>;
138          clocks = <&ccu 0>, <&ccu 1>;
139          clock-names = "bus", "mod";
140          resets = <&ccu 2>;
141          interrupts = <0 31 0>;
142          nvmem-cells = <&ths_calibration>;
143          nvmem-cell-names = "calibration";
144          #thermal-sensor-cells = <0>;
145     };
147   - |
148     thermal-sensor@5070400 {
149          compatible = "allwinner,sun50i-h6-ths";
150          reg = <0x05070400 0x100>;
151          clocks = <&ccu 0>;
152          clock-names = "bus";
153          resets = <&ccu 2>;
154          interrupts = <0 15 0>;
155          nvmem-cells = <&ths_calibration>;
156          nvmem-cell-names = "calibration";
157          #thermal-sensor-cells = <1>;
158     };