* [PATCH] dt-bindings: thermal: rcar-gen3-thermal: Convert bindings to json-schema
@ 2020-03-10 0:12 Niklas Söderlund
2020-03-23 21:24 ` Rob Herring
0 siblings, 1 reply; 2+ messages in thread
From: Niklas Söderlund @ 2020-03-10 0:12 UTC (permalink / raw)
To: Rob Herring, linux-pm, devicetree
Cc: linux-renesas-soc, Niklas Söderlund
Convert Renesas R-Car Gen3 Thermal bindings documentation to
json-schema.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
.../bindings/thermal/rcar-gen3-thermal.txt | 59 ------------
.../bindings/thermal/rcar-gen3-thermal.yaml | 96 +++++++++++++++++++
2 files changed, 96 insertions(+), 59 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt
create mode 100644 Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
diff --git a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt
deleted file mode 100644
index 12c740b975f78690..0000000000000000
--- a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-* DT bindings for Renesas R-Car Gen3 Thermal Sensor driver
-
-On R-Car Gen3 SoCs, the thermal sensor controllers (TSC) control the thermal
-sensors (THS) which are the analog circuits for measuring temperature (Tj)
-inside the LSI.
-
-Required properties:
-- compatible : "renesas,<soctype>-thermal",
- Examples with soctypes are:
- - "renesas,r8a774a1-thermal" (RZ/G2M)
- - "renesas,r8a774b1-thermal" (RZ/G2N)
- - "renesas,r8a7795-thermal" (R-Car H3)
- - "renesas,r8a7796-thermal" (R-Car M3-W)
- - "renesas,r8a77965-thermal" (R-Car M3-N)
- - "renesas,r8a77980-thermal" (R-Car V3H)
-- reg : Address ranges of the thermal registers. Each sensor
- needs one address range. Sorting must be done in
- increasing order according to datasheet, i.e.
- TSC1, TSC2, ...
-- clocks : Must contain a reference to the functional clock.
-- #thermal-sensor-cells : must be <1>.
-
-Optional properties:
-
-- interrupts : interrupts routed to the TSC (must be 3).
-- power-domain : Must contain a reference to the power domain. This
- property is mandatory if the thermal sensor instance
- is part of a controllable power domain.
-
-Example:
-
- tsc: thermal@e6198000 {
- compatible = "renesas,r8a7795-thermal";
- reg = <0 0xe6198000 0 0x100>,
- <0 0xe61a0000 0 0x100>,
- <0 0xe61a8000 0 0x100>;
- interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&cpg CPG_MOD 522>;
- power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
- #thermal-sensor-cells = <1>;
- };
-
- thermal-zones {
- sensor_thermal1: sensor-thermal1 {
- polling-delay-passive = <250>;
- polling-delay = <1000>;
- thermal-sensors = <&tsc 0>;
-
- trips {
- sensor1_crit: sensor1-crit {
- temperature = <90000>;
- hysteresis = <2000>;
- type = "critical";
- };
- };
- };
- };
diff --git a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
new file mode 100644
index 0000000000000000..4b605482f3e38735
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
@@ -0,0 +1,96 @@
+# SPDX-License-Identifier: GPL-2.0-only
+# Copyright (C) 2020 Renesas Electronics Corp.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/rcar-gen3-thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas R-Car Gen3 Thermal Sensor
+
+description:
+ On R-Car Gen3 SoCs, the thermal sensor controllers (TSC) control the thermal
+ sensors (THS) which are the analog circuits for measuring temperature (Tj)
+ inside the LSI.
+
+maintainers:
+ - Niklas Söderlund <niklas.soderlund@ragnatech.se>
+
+properties:
+ compatible:
+ enum:
+ - renesas,r8a774a1-thermal # RZ/G2M
+ - renesas,r8a774b1-thermal # RZ/G2N
+ - renesas,r8a7795-thermal # R-Car H3
+ - renesas,r8a7796-thermal # R-Car M3-W
+ - renesas,r8a77965-thermal # R-Car M3-N
+ - renesas,r8a77980-thermal # R-Car V3H
+ reg:
+ description:
+ Address ranges of the thermal registers. Each sensor needs one address
+ range. Sorting must be done in increasing order according to datasheet,
+ i.e. TSC1, TSC2, ...
+ minItems: 1
+ maxItems: 4
+
+ interrupts:
+ minItems: 3
+ maxItems: 3
+
+ clocks:
+ maxItems: 1
+
+ power-domains:
+ maxItems: 1
+
+ resets:
+ maxItems: 1
+
+ "#thermal-sensor-cells":
+ const: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - power-domains
+ - resets
+ - "#thermal-sensor-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/power/r8a7795-sysc.h>
+
+ tsc: thermal@e6198000 {
+ compatible = "renesas,r8a7795-thermal";
+ reg = <0 0xe6198000 0 0x100>,
+ <0 0xe61a0000 0 0x100>,
+ <0 0xe61a8000 0 0x100>;
+ interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cpg CPG_MOD 522>;
+ power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+ resets = <&cpg 522>;
+ #thermal-sensor-cells = <1>;
+ };
+
+ thermal-zones {
+ sensor_thermal1: sensor-thermal1 {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+ thermal-sensors = <&tsc 0>;
+
+ trips {
+ sensor1_crit: sensor1-crit {
+ temperature = <90000>;
+ hysteresis = <2000>;
+ type = "critical";
+ };
+ };
+ };
+ };
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dt-bindings: thermal: rcar-gen3-thermal: Convert bindings to json-schema
2020-03-10 0:12 [PATCH] dt-bindings: thermal: rcar-gen3-thermal: Convert bindings to json-schema Niklas Söderlund
@ 2020-03-23 21:24 ` Rob Herring
0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2020-03-23 21:24 UTC (permalink / raw)
To: Niklas Söderlund; +Cc: linux-pm, devicetree, linux-renesas-soc
On Tue, Mar 10, 2020 at 01:12:55AM +0100, Niklas Söderlund wrote:
> Convert Renesas R-Car Gen3 Thermal bindings documentation to
> json-schema.
Mostly looks fine, but I'd like to make sure this works with the common
binding Amit is converting. I see one issue with that.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> .../bindings/thermal/rcar-gen3-thermal.txt | 59 ------------
> .../bindings/thermal/rcar-gen3-thermal.yaml | 96 +++++++++++++++++++
> 2 files changed, 96 insertions(+), 59 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt
> create mode 100644 Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
>
> diff --git a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt
> deleted file mode 100644
> index 12c740b975f78690..0000000000000000
> --- a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt
> +++ /dev/null
> @@ -1,59 +0,0 @@
> -* DT bindings for Renesas R-Car Gen3 Thermal Sensor driver
> -
> -On R-Car Gen3 SoCs, the thermal sensor controllers (TSC) control the thermal
> -sensors (THS) which are the analog circuits for measuring temperature (Tj)
> -inside the LSI.
> -
> -Required properties:
> -- compatible : "renesas,<soctype>-thermal",
> - Examples with soctypes are:
> - - "renesas,r8a774a1-thermal" (RZ/G2M)
> - - "renesas,r8a774b1-thermal" (RZ/G2N)
> - - "renesas,r8a7795-thermal" (R-Car H3)
> - - "renesas,r8a7796-thermal" (R-Car M3-W)
> - - "renesas,r8a77965-thermal" (R-Car M3-N)
> - - "renesas,r8a77980-thermal" (R-Car V3H)
> -- reg : Address ranges of the thermal registers. Each sensor
> - needs one address range. Sorting must be done in
> - increasing order according to datasheet, i.e.
> - TSC1, TSC2, ...
> -- clocks : Must contain a reference to the functional clock.
> -- #thermal-sensor-cells : must be <1>.
> -
> -Optional properties:
> -
> -- interrupts : interrupts routed to the TSC (must be 3).
> -- power-domain : Must contain a reference to the power domain. This
> - property is mandatory if the thermal sensor instance
> - is part of a controllable power domain.
> -
> -Example:
> -
> - tsc: thermal@e6198000 {
> - compatible = "renesas,r8a7795-thermal";
> - reg = <0 0xe6198000 0 0x100>,
> - <0 0xe61a0000 0 0x100>,
> - <0 0xe61a8000 0 0x100>;
> - interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
> - <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
> - <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
> - clocks = <&cpg CPG_MOD 522>;
> - power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
> - #thermal-sensor-cells = <1>;
> - };
> -
> - thermal-zones {
> - sensor_thermal1: sensor-thermal1 {
> - polling-delay-passive = <250>;
> - polling-delay = <1000>;
> - thermal-sensors = <&tsc 0>;
> -
> - trips {
> - sensor1_crit: sensor1-crit {
> - temperature = <90000>;
> - hysteresis = <2000>;
> - type = "critical";
> - };
> - };
> - };
> - };
> diff --git a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
> new file mode 100644
> index 0000000000000000..4b605482f3e38735
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
> @@ -0,0 +1,96 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +# Copyright (C) 2020 Renesas Electronics Corp.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/thermal/rcar-gen3-thermal.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas R-Car Gen3 Thermal Sensor
> +
> +description:
> + On R-Car Gen3 SoCs, the thermal sensor controllers (TSC) control the thermal
> + sensors (THS) which are the analog circuits for measuring temperature (Tj)
> + inside the LSI.
> +
> +maintainers:
> + - Niklas Söderlund <niklas.soderlund@ragnatech.se>
> +
> +properties:
> + compatible:
> + enum:
> + - renesas,r8a774a1-thermal # RZ/G2M
> + - renesas,r8a774b1-thermal # RZ/G2N
> + - renesas,r8a7795-thermal # R-Car H3
> + - renesas,r8a7796-thermal # R-Car M3-W
> + - renesas,r8a77965-thermal # R-Car M3-N
> + - renesas,r8a77980-thermal # R-Car V3H
> + reg:
> + description:
> + Address ranges of the thermal registers. Each sensor needs one address
> + range. Sorting must be done in increasing order according to datasheet,
Generally, the order should be by function. I guess if each entry has
the same set of registers (i.e. is homogeneous), then it doesn't matter.
> + i.e. TSC1, TSC2, ...
> + minItems: 1
> + maxItems: 4
> +
> + interrupts:
> + minItems: 3
> + maxItems: 3
Need to define what each one is.
> +
> + clocks:
> + maxItems: 1
> +
> + power-domains:
> + maxItems: 1
> +
> + resets:
> + maxItems: 1
> +
> + "#thermal-sensor-cells":
> + const: 1
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - clocks
> + - power-domains
> + - resets
> + - "#thermal-sensor-cells"
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + #include <dt-bindings/power/r8a7795-sysc.h>
> +
> + tsc: thermal@e6198000 {
> + compatible = "renesas,r8a7795-thermal";
> + reg = <0 0xe6198000 0 0x100>,
> + <0 0xe61a0000 0 0x100>,
> + <0 0xe61a8000 0 0x100>;
> + interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&cpg CPG_MOD 522>;
> + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
> + resets = <&cpg 522>;
> + #thermal-sensor-cells = <1>;
> + };
> +
> + thermal-zones {
> + sensor_thermal1: sensor-thermal1 {
Node names should end in '-thermal'.
> + polling-delay-passive = <250>;
> + polling-delay = <1000>;
> + thermal-sensors = <&tsc 0>;
> +
> + trips {
> + sensor1_crit: sensor1-crit {
> + temperature = <90000>;
> + hysteresis = <2000>;
> + type = "critical";
> + };
> + };
> + };
> + };
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-23 21:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 0:12 [PATCH] dt-bindings: thermal: rcar-gen3-thermal: Convert bindings to json-schema Niklas Söderlund
2020-03-23 21:24 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).