From 38dd0e4162b698a3007d4eee771e34810d3a8f9a Mon Sep 17 00:00:00 2001 From: Yangtao Li Date: Thu, 28 Nov 2019 22:31:28 +0800 Subject: [PATCH] dt-bindings: thermal: add YAML schema for sun8i-thermal driver bindings sun8i-thermal driver supports thermal sensor in wide range of Allwinner SoCs. Add YAML schema for its bindings. Signed-off-by: Yangtao Li --- .../bindings/thermal/sun8i-thermal.yaml | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml diff --git a/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml new file mode 100644 index 000000000000..1be32f09fcc8 --- /dev/null +++ b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml @@ -0,0 +1,160 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/sun8i-thermal.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Allwinner SUN8I Thermal Controller Device Tree Bindings + +maintainers: + - Yangtao Li + +description: |- + This describes the device tree binding for the Allwinner thermal + controller which measures the on-SoC temperatures. + +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 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + resets: + maxItems: 1 + + clocks: + minItems: 1 + maxItems: 2 + items: + - description: ths bus clock + - description: ths mod clock + + clock-names: + minItems: 1 + maxItems: 2 + items: + - const: bus + - const: mod + + "#thermal-sensor-cells": + enum: [ 0, 1 ] + + nvmem-cells: + description: ths calibrate data + + nvmem-cell-names: + const: calibration + +required: + - compatible + - reg + - interrupts + - "#thermal-sensor-cells" + +allOf: + - if: + properties: + compatible: + contains: + enum: + - allwinner,sun8i-h3-ths + - allwinner,sun8i-r40-ths + - allwinner,sun50i-a64-ths + - allwinner,sun50i-h5-ths + - allwinner,sun50i-h6-ths + + then: + properties: + resets: + minItems: 1 + maxItems: 1 + + - if: + properties: + compatible: + contains: + const: allwinner,sun50i-h6-ths + + then: + properties: + clocks: + minItems: 1 + maxItems: 1 + + clock-names: + minItems: 1 + maxItems: 1 + + else: + if: + properties: + compatible: + contains: + enum: + - allwinner,sun8i-h3-ths + - allwinner,sun8i-r40-ths + - allwinner,sun50i-a64-ths + - allwinner,sun50i-h5-ths + + then: + properties: + clocks: + minItems: 2 + maxItems: 2 + + clock-names: + minItems: 2 + maxItems: 2 + + - if: + properties: + compatible: + contains: + const: allwinner,sun8i-h3-ths + + then: + properties: + "#thermal-sensor-cells": + const: 0 + + else: + properties: + "#thermal-sensor-cells": + const: 1 + +additionalProperties: false + +examples: + - | + ths: ths@5070400 { + compatible = "allwinner,sun50i-h6-ths"; + reg = <0x05070400 0x100>; + clocks = <&ccu 89>; + clock-names = "bus"; + resets = <&ccu 36>; + interrupts = <0 15 4>; + nvmem-cells = <&tsen_calib>; + nvmem-cell-names = "calibration"; + #thermal-sensor-cells = <1>; + }; + + sid: sid@3006000 { + compatible = "allwinner,sun50i-h6-sid"; + reg = <0x03006000 0x400>; + #address-cells = <1>; + #size-cells = <1>; + tsen_calib: calib@14 { + reg = <0x14 6>; + }; + }; +... -- 2.17.1