Skip to contentSkip to conversation

dt-bindings: thermal: Convert i.MX8MM to json-schema

PATCH In review Anson Huang 2 participants 4 messages Apr 9, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: thermal: Convert i.MX8MM to json-schema

Convert the i.MX8MM thermal binding to DT schema format using json-schema

---
 .../devicetree/bindings/thermal/imx8mm-thermal.txt | 15 ------
 .../bindings/thermal/imx8mm-thermal.yaml           | 53 ++++++++++++++++++++++
 2 files changed, 53 insertions(+), 15 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt
 create mode 100644 Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml
Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt deleted +0 -15
deleted file mode 100644
index 3629d3c..0000000
@@ -1,15 +0,0 @@
-* Thermal Monitoring Unit (TMU) on Freescale i.MX8MM SoC
-
-Required properties:
-- compatible : Must be "fsl,imx8mm-tmu" or "fsl,imx8mp-tmu".
-- reg : Address range of TMU registers.
-- clocks : TMU's clock source.
-- #thermal-sensor-cells : Should be 0 or 1. See ./thermal.txt for a description.
-
-Example:
-tmu: tmu@30260000 {
-	compatible = "fsl,imx8mm-tmu";
-	reg = <0x30260000 0x10000>;
-	clocks = <&clk IMX8MM_CLK_TMU_ROOT>;
-	#thermal-sensor-cells = <0>;
-};
Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file +53 -0

53 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

Hi Anson,

Quoted 2 lines · Anson Huang

Convert the i.MX8MM thermal binding to DT schema format using json-schema

Would it be possible to have a single yaml file for all i.MX thermal sensors by playing with required and optional properties ?

Quoted 53 lines
---
 .../devicetree/bindings/thermal/imx8mm-thermal.txt | 15 ------
 .../bindings/thermal/imx8mm-thermal.yaml           | 53 ++++++++++++++++++++++
 2 files changed, 53 insertions(+), 15 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt
 create mode 100644 Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml
Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt deleted +0 -15
deleted file mode 100644
index 3629d3c..0000000
@@ -1,15 +0,0 @@
-* Thermal Monitoring Unit (TMU) on Freescale i.MX8MM SoC
-
-Required properties:
-- compatible : Must be "fsl,imx8mm-tmu" or "fsl,imx8mp-tmu".
-- reg : Address range of TMU registers.
-- clocks : TMU's clock source.
-- #thermal-sensor-cells : Should be 0 or 1. See ./thermal.txt for a description.
-
-Example:
-tmu: tmu@30260000 {
-       compatible = "fsl,imx8mm-tmu";
-       reg = <0x30260000 0x10000>;
-       clocks = <&clk IMX8MM_CLK_TMU_ROOT>;
-       #thermal-sensor-cells = <0>;
-};
Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file +18 -0
new file mode 100644
index 0000000..53a42b3
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/imx8mm-thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX8M Mini Thermal Binding
+
+maintainers:
+  - Anson Huang <[email protected]>
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - fsl,imx8mm-tmu
+              - fsl,imx8mp-tmu

Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml line 28

Quoted 10 lines
Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file +10 -0
+  reg:
+    description: |
+      Address range of TMU registers.
+    maxItems: 1
+  clocks:
+    description: |
+      TMU's clock source.
+    maxItems: 1
+
+  # See ./thermal.txt for details

Don't point to thermal.txt anymore. thermal.txt will be replaced by thermal-*.yaml files at some point soon.

Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml line 31

Quoted 3 lines
Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file +3 -0
+  "#thermal-sensor-cells":
+    enum:
+      - 0

Don't you have multiple sensors connected to this controller? In that case, 0 won't be a valid value.

Quoted 25 lines
Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file +22 -1
+      - 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - '#thermal-sensor-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx8mm-clock.h>
+
+    tmu: tmu@30260000 {
+         compatible = "fsl,imx8mm-tmu";
+         reg = <0x30260000 0x10000>;
+         clocks = <&clk IMX8MM_CLK_TMU_ROOT>;
+         #thermal-sensor-cells = <0>;
+    };
+
+...
--

2.7.4

#2 lore raw

Hi, Amit

Quoted 4 lines

Subject: Re: [PATCH] dt-bindings: thermal: Convert i.MX8MM to json-schema

Hi Anson,

Quoted 8 lines
Quoted 3 lines · Anson Huang

Convert the i.MX8MM thermal binding to DT schema format using json-schema

Would it be possible to have a single yaml file for all i.MX thermal sensors by playing with required and optional properties ?

i.MX SoCs have many different thermal sensor IP and hence different thermal driver is used, and different i.MX thermal drivers have different DT bindings, so is it good to put all of them into single yaml file? For example, imx_thermal.c is for i.MX6/7 SoCs which do NOT use of_thermal framework, imx8mm_thermal.c is for i.MX8MM/i.MX8MP which use of_thermal framework.

If putting all of them into 1 yaml file, it will be almost like just putting 2 files together, I Personally don't think it is a good idea.

Quoted 89 lines
Quoted 5 lines
---
 .../devicetree/bindings/thermal/imx8mm-thermal.txt | 15 ------
 .../bindings/thermal/imx8mm-thermal.yaml           | 53

++++++++++++++++++++++

Quoted 37 lines
 2 files changed, 53 insertions(+), 15 deletions(-)  delete mode
100644 Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt
 create mode 100644

Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml

diff --git a/Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt b/Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt deleted file mode 100644
index 3629d3c..0000000

Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt deleted +0 -15
@@ -1,15 +0,0 @@
-* Thermal Monitoring Unit (TMU) on Freescale i.MX8MM SoC
-
-Required properties:
-- compatible : Must be "fsl,imx8mm-tmu" or "fsl,imx8mp-tmu".
-- reg : Address range of TMU registers.
-- clocks : TMU's clock source.
-- #thermal-sensor-cells : Should be 0 or 1. See ./thermal.txt for a description.
-
-Example:
-tmu: tmu@30260000 {
-       compatible = "fsl,imx8mm-tmu";
-       reg = <0x30260000 0x10000>;
-       clocks = <&clk IMX8MM_CLK_TMU_ROOT>;
-       #thermal-sensor-cells = <0>;
-};

diff --git a/Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml b/Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file mode 100644
index 0000000..53a42b3

Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml line 5

Quoted 5 lines
Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file +5 -0
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id:
+https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi

+cetree.org%2Fschemas%2Fthermal%2Fimx8mm-thermal.yaml%23&amp;data =02%7

Quoted 1 line

+C01%7CAnson.Huang%40nxp.com%7Cb190e049130e49e0750d08d7dc8e48 a3%7C686e

Quoted 1 line

+a1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637220375963888457&am p;sdata=s

Quoted 1 line

+S8%2FR2j%2BT1UmDqXFIPPzPgWs26lMiwW3saTq4qlZAUs%3D&amp;reserve d=0

Quoted 3 lines

+$schema:
+https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi

+cetree.org%2Fmeta-schemas%2Fcore.yaml%23&amp;data=02%7C01%7CAns on.Hua

Quoted 1 line

+ng%40nxp.com%7Cb190e049130e49e0750d08d7dc8e48a3%7C686ea1d3bc 2b4c6fa92

Quoted 1 line

+cd99c5c301635%7C0%7C0%7C637220375963898454&amp;sdata=tXIh9d% 2BszcExH0

Quoted 19 lines

+7ic7s%2BqJyUdbE0aHM3tH%2BwkWgnbhQ%3D&amp;reserved=0

Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file +18 -0
+
+title: NXP i.MX8M Mini Thermal Binding
+
+maintainers:
+  - Anson Huang <[email protected]>
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - fsl,imx8mm-tmu
+              - fsl,imx8mp-tmu
+  reg:
+    description: |
+      Address range of TMU registers.
+    maxItems: 1
+  clocks:
Quoted 8 lines

Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml line 28

Quoted 5 lines
Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file +5 -0
+    description: |
+      TMU's clock source.
+    maxItems: 1
+
+  # See ./thermal.txt for details

Don't point to thermal.txt anymore. thermal.txt will be replaced by thermal-*.yaml files at some point soon.

OK, will remove it.

Quoted 7 lines

Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml line 31

Quoted 4 lines
Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file +3 -0
+  "#thermal-sensor-cells":
+    enum:
+      - 0

Don't you have multiple sensors connected to this controller? In that case, 0 won't be a valid value.

imx8mm_thermal driver is for i.MX8MM and i.MX8MP, i.MX8MM ONLY has 1 sensor, while i.MX8MP has 2 sensors, that is why I put both 0 and 1 here.

Thanks,
Anson

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw
Quoted 16 lines · Anson Huang

Hi, Amit

Quoted 4 lines

Subject: Re: [PATCH] dt-bindings: thermal: Convert i.MX8MM to json-schema

Hi Anson,

Quoted 8 lines
Quoted 3 lines · Anson Huang

Convert the i.MX8MM thermal binding to DT schema format using json-schema

Would it be possible to have a single yaml file for all i.MX thermal sensors by playing with required and optional properties ?

Quoted 8 lines

i.MX SoCs have many different thermal sensor IP and hence different thermal driver is used, and different i.MX thermal drivers have different DT bindings, so is it good to put all of them into single yaml file? For example, imx_thermal.c is for i.MX6/7 SoCs which do NOT use of_thermal framework, imx8mm_thermal.c is for i.MX8MM/i.MX8MP which use of_thermal framework.

If putting all of them into 1 yaml file, it will be almost like just putting 2 files together, I Personally don't think it is a good idea.

OK.

Quoted 105 lines
Quoted 89 lines
Quoted 5 lines
---
 .../devicetree/bindings/thermal/imx8mm-thermal.txt | 15 ------
 .../bindings/thermal/imx8mm-thermal.yaml           | 53

++++++++++++++++++++++

Quoted 37 lines
 2 files changed, 53 insertions(+), 15 deletions(-)  delete mode
100644 Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt
 create mode 100644

Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml

diff --git a/Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt b/Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt deleted file mode 100644
index 3629d3c..0000000

Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt deleted +0 -15
@@ -1,15 +0,0 @@
-* Thermal Monitoring Unit (TMU) on Freescale i.MX8MM SoC
-
-Required properties:
-- compatible : Must be "fsl,imx8mm-tmu" or "fsl,imx8mp-tmu".
-- reg : Address range of TMU registers.
-- clocks : TMU's clock source.
-- #thermal-sensor-cells : Should be 0 or 1. See ./thermal.txt for a description.
-
-Example:
-tmu: tmu@30260000 {
-       compatible = "fsl,imx8mm-tmu";
-       reg = <0x30260000 0x10000>;
-       clocks = <&clk IMX8MM_CLK_TMU_ROOT>;
-       #thermal-sensor-cells = <0>;
-};

diff --git a/Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml b/Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file mode 100644
index 0000000..53a42b3

Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml line 5

Quoted 5 lines
Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file +5 -0
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id:
+https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi

+cetree.org%2Fschemas%2Fthermal%2Fimx8mm-thermal.yaml%23&amp;data =02%7

Quoted 1 line

+C01%7CAnson.Huang%40nxp.com%7Cb190e049130e49e0750d08d7dc8e48 a3%7C686e

Quoted 1 line

+a1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637220375963888457&am p;sdata=s

Quoted 1 line

+S8%2FR2j%2BT1UmDqXFIPPzPgWs26lMiwW3saTq4qlZAUs%3D&amp;reserve d=0

Quoted 3 lines

+$schema:
+https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi

+cetree.org%2Fmeta-schemas%2Fcore.yaml%23&amp;data=02%7C01%7CAns on.Hua

Quoted 1 line

+ng%40nxp.com%7Cb190e049130e49e0750d08d7dc8e48a3%7C686ea1d3bc 2b4c6fa92

Quoted 1 line

+cd99c5c301635%7C0%7C0%7C637220375963898454&amp;sdata=tXIh9d% 2BszcExH0

Quoted 19 lines

+7ic7s%2BqJyUdbE0aHM3tH%2BwkWgnbhQ%3D&amp;reserved=0

Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file +18 -0
+
+title: NXP i.MX8M Mini Thermal Binding
+
+maintainers:
+  - Anson Huang <[email protected]>
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - fsl,imx8mm-tmu
+              - fsl,imx8mp-tmu
+  reg:
+    description: |
+      Address range of TMU registers.
+    maxItems: 1
+  clocks:
Quoted 8 lines

Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml line 28

Quoted 5 lines
Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file +5 -0
+    description: |
+      TMU's clock source.
+    maxItems: 1
+
+  # See ./thermal.txt for details

Don't point to thermal.txt anymore. thermal.txt will be replaced by thermal-*.yaml files at some point soon.

OK, will remove it.

Quoted 5 lines
Quoted 4 lines
Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml new file +3 -0
+  "#thermal-sensor-cells":
+    enum:
+      - 0
Quoted 5 lines
Quoted 2 lines

Don't you have multiple sensors connected to this controller? In that case, 0 won't be a valid value.

imx8mm_thermal driver is for i.MX8MM and i.MX8MP, i.MX8MM ONLY has 1 sensor, while i.MX8MP has 2 sensors, that is why I put both 0 and 1 here.

Please put this in description after maintainers above.