Skip to content

Commit

Permalink
dt-bindings: thermal: add YAML schema for sun8i-thermal driver bindings
Browse files Browse the repository at this point in the history
sun8i-thermal driver supports thermal sensor in wide range of Allwinner
SoCs. Add YAML schema for its bindings.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
  • Loading branch information
TinyWindzz authored and anarsoul committed Dec 18, 2019
1 parent 6be5a0d commit 5d434d6
Showing 1 changed file with 160 additions and 0 deletions.
@@ -0,0 +1,160 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/thermal/allwinner,sun8i-a83t-ths.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner SUN8I Thermal Controller Device Tree Bindings

maintainers:
- Vasily Khoruzhick <anarsoul@gmail.com>
- Yangtao Li <tiny.windzz@gmail.com>

properties:
compatible:
enum:
- allwinner,sun8i-a83t-ths
- allwinner,sun8i-h3-ths
- allwinner,sun8i-r40-ths
- allwinner,sun50i-a64-ths
- allwinner,sun50i-h5-ths
- allwinner,sun50i-h6-ths

clocks:
minItems: 1
maxItems: 2
items:
- description: Bus Clock
- description: Module Clock

clock-names:
minItems: 1
maxItems: 2
items:
- const: bus
- const: mod

reg:
maxItems: 1

interrupts:
maxItems: 1

resets:
maxItems: 1

nvmem-cells:
maxItems: 1
description: Calibration data for thermal sensors

nvmem-cell-names:
const: calibration

"#thermal-sensor-cells":
enum:
- 0
- 1

allOf:
- if:
properties:
compatible:
contains:
const: allwinner,sun50i-h6-ths

then:
properties:
clocks:
maxItems: 1

clock-names:
maxItems: 1

else:
properties:
clocks:
minItems: 2

clock-names:
minItems: 2

- if:
properties:
compatible:
contains:
const: allwinner,sun8i-h3-ths

then:
properties:
"#thermal-sensor-cells":
const: 0

else:
properties:
"#thermal-sensor-cells":
description: Argument is sensor number starting with 0
const: 1

- if:
properties:
compatible:
contains:
enum:
- const: allwinner,sun8i-h3-ths
- const: allwinner,sun8i-r40-ths
- const: allwinner,sun50i-a64-ths
- const: allwinner,sun50i-h5-ths
- const: allwinner,sun50i-h6-ths

then:
required:
- clocks
- clock-names
- resets

required:
- compatible
- reg
- interrupts
- '#thermal-sensor-cells'

additionalProperties: false

examples:
- |
thermal-sensor@1f04000 {
compatible = "allwinner,sun8i-a83t-ths";
reg = <0x01f04000 0x100>;
interrupts = <0 31 0>;
nvmem-cells = <&ths_calibration>;
nvmem-cell-names = "calibration";
#thermal-sensor-cells = <1>;
};
- |
thermal-sensor@1c25000 {
compatible = "allwinner,sun8i-h3-ths";
reg = <0x01c25000 0x400>;
clocks = <&ccu 0>, <&ccu 1>;
clock-names = "bus", "mod";
resets = <&ccu 2>;
interrupts = <0 31 0>;
nvmem-cells = <&ths_calibration>;
nvmem-cell-names = "calibration";
#thermal-sensor-cells = <0>;
};
- |
thermal-sensor@5070400 {
compatible = "allwinner,sun50i-h6-ths";
reg = <0x05070400 0x100>;
clocks = <&ccu 0>;
clock-names = "bus";
resets = <&ccu 2>;
interrupts = <0 15 0>;
nvmem-cells = <&ths_calibration>;
nvmem-cell-names = "calibration";
#thermal-sensor-cells = <1>;
};
...

0 comments on commit 5d434d6

Please sign in to comment.