dt-bindings: thermal: mediatek: Move auxdac binding to yaml
Subsystems (3)
PATCH 1/2 dt-bindings: thermal: mediatek: Move auxdac binding to yaml
From: Matthias Brugger <[email protected]>
Convert the older binding to yaml syntax.
---
.../bindings/thermal/mediatek,thermal.yaml | 168 ++++++++++++++++++ .../bindings/thermal/mediatek-thermal.txt | 52 ------ 2 files changed, 168 insertions(+), 52 deletions(-) create mode 100644 Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml delete mode 100644 Documentation/devicetree/bindings/thermal/mediatek-thermal.txt
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +168 -0
@@ -0,0 +1,168 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/mediatek,thermal.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek Thermal Sensor + +maintainers: + - Matthias Brugger <[email protected]> + +description: | + The MediaTek thermal controller measures the on-SoC temperatures. + This device does not have its own ADC, instead it directly controls + the AUXADC via AHB bus accesses. For this reason this device needs + phandles to the AUXADC. Also it controls a mux in the apmixedsys + register space via AHB bus accesses, so a phandle to the APMIXEDSYS + is also needed. + +properties: + compatible: + oneOf: + - enum: + - mediatek,mt2701-thermal + - mediatek,mt2712-thermal + - mediatek,mt7622-thermal + - mediatek,mt7986-thermal + - mediatek,mt8173-thermal + - mediatek,mt8183-thermal + - mediatek,mt8365-thermal + - items: + - const: mediatek,mt7981-thermal + - const: mediatek,mt7986-thermal + - items: + - const: mediatek,mt8516-thermal + - const: mediatek,mt2701-thermal + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + minItems: 2 + + clock-names: + items: + - const: therm + - const: auxadc + + resets: + maxItems: 1 + description: Reference to the reset controller controlling the thermal controller. + + reset-names: + items: + - const: therm + + nvmem-cells: + items: + - description: Calibration eFuse data. If unspecified default values are used. + + nvmem-cell-names: + items: + - const: calibration-data + + mediatek,auxadc: + $ref: /schemas/types.yaml#/definitions/phandle + description: + A phandle to the AUXADC which the thermal controller uses. + + mediatek,apmixedsys: + $ref: /schemas/types.yaml#/definitions/phandle + description: + A phandle to the APMIXEDSYS controller. + + "#thermal-sensor-cells": + const: 1 + + bank0-supply: + description: Regulator node supplying voltage to the first bank + + bank1-supply: + description: Regulator node supplying voltage to the second bank + + +required: + - compatible + - reg + - interrupts + - clocks + - mediatek,auxadc + - mediatek,apmixedsys + - "#thermal-sensor-cells" + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/clock/mt8173-clk.h> + #include <dt-bindings/reset/mt8173-resets.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + auxadc: auxadc@11001000 { + compatible = "mediatek,mt8173-auxadc"; + reg = <0 0x11001000 0 0x1000>; + clocks = <&pericfg CLK_PERI_AUXADC>; + clock-names = "main"; + #io-channel-cells = <1>; + }; + + apmixedsys: clock-controller@10209000 { + compatible = "mediatek,mt8173-apmixedsys"; + reg = <0 0x10209000 0 0x1000>; + #clock-cells = <1>; + }; + + thermal: thermal@1100b000 { + #thermal-sensor-cells = <1>; + compatible = "mediatek,mt8173-thermal"; + reg = <0 0x1100b000 0 0x1000>; + interrupts = <0 70 IRQ_TYPE_LEVEL_LOW>; + clocks = <&pericfg CLK_PERI_THERM>, <&pericfg CLK_PERI_AUXADC>; + clock-names = "therm", "auxadc"; + resets = <&pericfg MT8173_PERI_THERM_SW_RST>; + reset-names = "therm"; + mediatek,auxadc = <&auxadc>; + mediatek,apmixedsys = <&apmixedsys>; + nvmem-cells = <&thermal_calibration_data>; + nvmem-cell-names = "calibration-data"; + }; + + thermal-zones { + cpu_thermal: cpu-thermal { + polling-delay-passive = <1000>; + polling-delay = <1000>; + + thermal-sensors = <&thermal 0>; + sustainable-power = <1500>; + + trips { + threshold: trip-point0 { + temperature = <68000>; + hysteresis = <2000>; + type = "passive"; + }; + + target: trip-point1 { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + + cpu_crit: cpu_crit0 { + temperature = <115000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + }; + }; +...
Documentation/devicetree/bindings/thermal/mediatek-thermal.txt deleted +0 -52
52 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH 2/2 arm64: dts: mt8173: Update thermal node
From: Matthias Brugger <[email protected]>
Following the binding description, update to use
thermal-sensor-cells = 1
---
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/mediatek/mt8173.dtsi +2 -2
@@ -270,7 +270,7 @@ cpu_thermal: cpu-thermal { polling-delay-passive = <1000>; /* milliseconds */ polling-delay = <1000>; /* milliseconds */ - thermal-sensors = <&thermal>; + thermal-sensors = <&thermal 0>; sustainable-power = <1500>; /* milliwatts */ trips {
@@ -766,7 +766,7 @@ spi: spi@1100a000 { }; thermal: thermal@1100b000 { - #thermal-sensor-cells = <0>; + #thermal-sensor-cells = <1>; compatible = "mediatek,mt8173-thermal"; reg = <0 0x1100b000 0 0x1000>; interrupts = <0 70 IRQ_TYPE_LEVEL_LOW>;
Signature · 1 line
2.40.1
Hey Matthias,
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 18
Quoted 6 lines · On Tue, May 30, 2023 at 05:04:12PM +0200, [email protected] wrote:
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +6
-0+ The MediaTek thermal controller measures the on-SoC temperatures. + This device does not have its own ADC, instead it directly controls + the AUXADC via AHB bus accesses. For this reason this device needs + phandles to the AUXADC. Also it controls a mux in the apmixedsys + register space via AHB bus accesses, so a phandle to the APMIXEDSYS + is also needed.
That double "also" bothers my OCD greatly, but it is a faithful conversion.
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml
Quoted 4 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +2
-1+ "#thermal-sensor-cells": + const: 1 -- #thermal-sensor-cells : Should be 0. See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for a description.
How come this has changed? I didn't see an explanation for it in either of the patches.
Cheers,
Conor.
Quoted 14 lines · Conor Dooley
Hey Matthias,
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 18
Quoted 6 lines · On Tue, May 30, 2023 at 05:04:12PM +0200, [email protected] wrote:
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +6
-0+ The MediaTek thermal controller measures the on-SoC temperatures. + This device does not have its own ADC, instead it directly controls + the AUXADC via AHB bus accesses. For this reason this device needs + phandles to the AUXADC. Also it controls a mux in the apmixedsys + register space via AHB bus accesses, so a phandle to the APMIXEDSYS + is also needed.That double "also" bothers my OCD greatly, but it is a faithful conversion.
Quoted 7 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml
Quoted 4 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +2
-1+ "#thermal-sensor-cells": + const: 1 -- #thermal-sensor-cells : Should be 0. See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for a description.How come this has changed? I didn't see an explanation for it in either of the patches.
Yep. Please mention the deviations from pure conversion and if not obvious - justify them.
Best regards,
Krzysztof
Quoted 54 lines · On 30/05/2023 17:04, [email protected] wrote:
From: Matthias Brugger <[email protected]>
Convert the older binding to yaml syntax.
Signed-off-by Matthias Brugger <[email protected]>---
.../bindings/thermal/mediatek,thermal.yaml | 168 ++++++++++++++++++ .../bindings/thermal/mediatek-thermal.txt | 52 ------ 2 files changed, 168 insertions(+), 52 deletions(-) create mode 100644 Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml delete mode 100644 Documentation/devicetree/bindings/thermal/mediatek-thermal.txtDocumentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +35
-0@@ -0,0 +1,168 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/mediatek,thermal.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek Thermal Sensor + +maintainers: + - Matthias Brugger <[email protected]> + +description: | + The MediaTek thermal controller measures the on-SoC temperatures. + This device does not have its own ADC, instead it directly controls + the AUXADC via AHB bus accesses. For this reason this device needs + phandles to the AUXADC. Also it controls a mux in the apmixedsys + register space via AHB bus accesses, so a phandle to the APMIXEDSYS + is also needed. + +properties: + compatible: + oneOf: + - enum: + - mediatek,mt2701-thermal + - mediatek,mt2712-thermal + - mediatek,mt7622-thermal + - mediatek,mt7986-thermal + - mediatek,mt8173-thermal + - mediatek,mt8183-thermal + - mediatek,mt8365-thermal + - items: + - const: mediatek,mt7981-thermal + - const: mediatek,mt7986-thermal + - items: + - const: mediatek,mt8516-thermal
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 45
Quoted 10 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +10
-0+ - const: mediatek,mt2701-thermal + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + minItems: 2
maxItems instead
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 54
Quoted 9 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +9
-0+ + clock-names: + items: + - const: therm + - const: auxadc + + resets: + maxItems: 1 + description: Reference to the reset controller controlling the thermal controller.
You can drop description, it's obvious.
Quoted 21 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +21
-0+ + reset-names: + items: + - const: therm + + nvmem-cells: + items: + - description: Calibration eFuse data. If unspecified default values are used. + + nvmem-cell-names: + items: + - const: calibration-data + + mediatek,auxadc: + $ref: /schemas/types.yaml#/definitions/phandle + description: + A phandle to the AUXADC which the thermal controller uses. + + mediatek,apmixedsys: + $ref: /schemas/types.yaml#/definitions/phandle + description:
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 85
Quoted 10 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +10
-0+ A phandle to the APMIXEDSYS controller. + + "#thermal-sensor-cells": + const: 1 + + bank0-supply: + description: Regulator node supplying voltage to the first bank + + bank1-supply: + description: Regulator node supplying voltage to the second bank
These were not present before. Mention this in commit msg. Also drop "node".
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 87
Quoted 2 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +2
-0+ +
Just one blank line.
Quoted 24 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +24
-0+required: + - compatible + - reg + - interrupts + - clocks + - mediatek,auxadc + - mediatek,apmixedsys + - "#thermal-sensor-cells" + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/clock/mt8173-clk.h> + #include <dt-bindings/reset/mt8173-resets.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + auxadc: auxadc@11001000 { + compatible = "mediatek,mt8173-auxadc"; + reg = <0 0x11001000 0 0x1000>;
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 121
Quoted 10 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +10
-0+ clocks = <&pericfg CLK_PERI_AUXADC>; + clock-names = "main"; + #io-channel-cells = <1>; + }; + + apmixedsys: clock-controller@10209000 { + compatible = "mediatek,mt8173-apmixedsys"; + reg = <0 0x10209000 0 0x1000>; + #clock-cells = <1>; + };
Drop both examples, not really relevant to thermal. It grows the example with code already documented somewhere else.
Quoted 28 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +28
-0+ + thermal: thermal@1100b000 { + #thermal-sensor-cells = <1>; + compatible = "mediatek,mt8173-thermal"; + reg = <0 0x1100b000 0 0x1000>; + interrupts = <0 70 IRQ_TYPE_LEVEL_LOW>; + clocks = <&pericfg CLK_PERI_THERM>, <&pericfg CLK_PERI_AUXADC>; + clock-names = "therm", "auxadc"; + resets = <&pericfg MT8173_PERI_THERM_SW_RST>; + reset-names = "therm"; + mediatek,auxadc = <&auxadc>; + mediatek,apmixedsys = <&apmixedsys>; + nvmem-cells = <&thermal_calibration_data>; + nvmem-cell-names = "calibration-data"; + }; + + thermal-zones { + cpu_thermal: cpu-thermal { + polling-delay-passive = <1000>; + polling-delay = <1000>; + + thermal-sensors = <&thermal 0>; + sustainable-power = <1500>; + + trips { + threshold: trip-point0 { + temperature = <68000>; + hysteresis = <2000>;
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 159
Quoted 10 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +10
-0+ type = "passive"; + }; + + target: trip-point1 { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + + cpu_crit: cpu_crit0 {
No underscores in node names.
Best regards,
Krzysztof
Quoted 148 lines · Krzysztof Kozlowski
Quoted 54 lines · On 30/05/2023 17:04, [email protected] wrote:
From: Matthias Brugger <[email protected]>
Convert the older binding to yaml syntax.
Signed-off-by Matthias Brugger <[email protected]>---
.../bindings/thermal/mediatek,thermal.yaml | 168 ++++++++++++++++++ .../bindings/thermal/mediatek-thermal.txt | 52 ------ 2 files changed, 168 insertions(+), 52 deletions(-)create mode 100644
Documentation/devicetree/bindings/thermal/mediatek,thermal.yamldelete mode 100644Documentation/devicetree/bindings/thermal/mediatek-thermal.txtDocumentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +35
-0@@ -0,0 +1,168 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/mediatek,thermal.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek Thermal Sensor + +maintainers: + - Matthias Brugger <[email protected]> + +description: | + The MediaTek thermal controller measures the on-SoC temperatures. + This device does not have its own ADC, instead it directly controls + the AUXADC via AHB bus accesses. For this reason this device needs + phandles to the AUXADC. Also it controls a mux in the apmixedsys + register space via AHB bus accesses, so a phandle to the APMIXEDSYS + is also needed. + +properties: + compatible: + oneOf: + - enum: + - mediatek,mt2701-thermal + - mediatek,mt2712-thermal + - mediatek,mt7622-thermal + - mediatek,mt7986-thermal + - mediatek,mt8173-thermal + - mediatek,mt8183-thermal + - mediatek,mt8365-thermal + - items: + - const: mediatek,mt7981-thermal + - const: mediatek,mt7986-thermal + - items: + - const: mediatek,mt8516-thermalDocumentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 45
Quoted 10 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +10
-0+ - const: mediatek,mt2701-thermal + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + minItems: 2maxItems instead
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 54
Quoted 9 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +9
-0+ + clock-names: + items: + - const: therm + - const: auxadc + + resets: + maxItems: 1 + description: Reference to the reset controller controlling the thermal controller.You can drop description, it's obvious.
Quoted 21 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +21
-0+ + reset-names: + items: + - const: therm + + nvmem-cells: + items: + - description: Calibration eFuse data. If unspecified default values are used. + + nvmem-cell-names: + items: + - const: calibration-data + + mediatek,auxadc: + $ref: /schemas/types.yaml#/definitions/phandle + description: + A phandle to the AUXADC which the thermal controller uses. + + mediatek,apmixedsys: + $ref: /schemas/types.yaml#/definitions/phandle + description:Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 85
Quoted 10 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +10
-0+ A phandle to the APMIXEDSYS controller. + + "#thermal-sensor-cells": + const: 1 + + bank0-supply: + description: Regulator node supplying voltage to the first bank + + bank1-supply: + description: Regulator node supplying voltage to the second bankThese were not present before. Mention this in commit msg. Also drop "node".
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 87
Quoted 2 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +2
-0+ +Just one blank line.
Quoted 29 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +29
-0+required: + - compatible + - reg + - interrupts + - clocks + - mediatek,auxadc + - mediatek,apmixedsys + - "#thermal-sensor-cells" + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/clock/mt8173-clk.h> + #include <dt-bindings/reset/mt8173-resets.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + auxadc: auxadc@11001000 { + compatible = "mediatek,mt8173-auxadc"; + reg = <0 0x11001000 0 0x1000>; + clocks = <&pericfg CLK_PERI_AUXADC>; + clock-names = "main"; + #io-channel-cells = <1>; + }; +
Quoted 9 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 121
Quoted 5 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +5
-0+ apmixedsys: clock-controller@10209000 { + compatible = "mediatek,mt8173-apmixedsys"; + reg = <0 0x10209000 0 0x1000>; + #clock-cells = <1>; + };Drop both examples, not really relevant to thermal. It grows the example with code already documented somewhere else.
auxadc and apmixedsys are no examples. They are referenced by the thermal node as described in the binding. Without them the example won't be complete.
Regards,
Matthias
Quoted 45 lines
Quoted 28 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +28
-0+ + thermal: thermal@1100b000 { + #thermal-sensor-cells = <1>; + compatible = "mediatek,mt8173-thermal"; + reg = <0 0x1100b000 0 0x1000>; + interrupts = <0 70 IRQ_TYPE_LEVEL_LOW>; + clocks = <&pericfg CLK_PERI_THERM>, <&pericfg CLK_PERI_AUXADC>; + clock-names = "therm", "auxadc"; + resets = <&pericfg MT8173_PERI_THERM_SW_RST>; + reset-names = "therm"; + mediatek,auxadc = <&auxadc>; + mediatek,apmixedsys = <&apmixedsys>; + nvmem-cells = <&thermal_calibration_data>; + nvmem-cell-names = "calibration-data"; + }; + + thermal-zones { + cpu_thermal: cpu-thermal { + polling-delay-passive = <1000>; + polling-delay = <1000>; + + thermal-sensors = <&thermal 0>; + sustainable-power = <1500>; + + trips { + threshold: trip-point0 { + temperature = <68000>; + hysteresis = <2000>;Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 159
Quoted 10 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +10
-0+ type = "passive"; + }; + + target: trip-point1 { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + + cpu_crit: cpu_crit0 {No underscores in node names.
Best regards,
Krzysztof
Quoted 22 lines · Matthias Brugger
Quoted 12 lines
Quoted 12 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +12
-0+ soc { + #address-cells = <2>; + #size-cells = <2>; + + auxadc: auxadc@11001000 { + compatible = "mediatek,mt8173-auxadc"; + reg = <0 0x11001000 0 0x1000>; + clocks = <&pericfg CLK_PERI_AUXADC>; + clock-names = "main"; + #io-channel-cells = <1>; + }; +Quoted 9 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml line 121
Quoted 5 lines
Documentation/devicetree/bindings/thermal/mediatek,thermal.yaml new file +5
-0+ apmixedsys: clock-controller@10209000 { + compatible = "mediatek,mt8173-apmixedsys"; + reg = <0 0x10209000 0 0x1000>; + #clock-cells = <1>; + };Drop both examples, not really relevant to thermal. It grows the example with code already documented somewhere else.
Quoted 3 lines
auxadc and apmixedsys are no examples. They are referenced by the thermal node as described in the binding. Without them the example won't be complete.
The example is complete, because you have phandles and that's enough. the auxadc and apmixedsys have their own examples in their own bindings
- no need to duplicate them here.
Best regards,
Krzysztof