diff mbox series

dt-bindings: thermal: rcar-gen3-thermal: Support five TSC nodes on r8a779a0

Message ID 20210309162205.2619943-1-niklas.soderlund+renesas@ragnatech.se
State Superseded
Headers show
Series dt-bindings: thermal: rcar-gen3-thermal: Support five TSC nodes on r8a779a0 | expand

Commit Message

Niklas Söderlund March 9, 2021, 4:22 p.m. UTC
When adding support for V3U (r8a779a0) it was incorrectly recorded it
supports four nodes, while in fact it supports five. The fifth node is
named TSC0 and breaks the existing naming schema starting at 1. Work
around this by separately defining the reg property for V3U and others.

Restore the maximum number of nodes to three for other compatibles as
it was before erroneously increasing it for V3U.

Fixes: d7fdfb6541f3be88 ("dt-bindings: thermal: rcar-gen3-thermal: Add r8a779a0 support")
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 .../bindings/thermal/rcar-gen3-thermal.yaml   | 43 +++++++++++++++----
 1 file changed, 35 insertions(+), 8 deletions(-)

Comments

Geert Uytterhoeven March 10, 2021, 10:06 a.m. UTC | #1
Hi Niklas,

On Tue, Mar 9, 2021 at 5:24 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> When adding support for V3U (r8a779a0) it was incorrectly recorded it
> supports four nodes, while in fact it supports five. The fifth node is
> named TSC0 and breaks the existing naming schema starting at 1. Work
> around this by separately defining the reg property for V3U and others.
>
> Restore the maximum number of nodes to three for other compatibles as
> it was before erroneously increasing it for V3U.
>
> Fixes: d7fdfb6541f3be88 ("dt-bindings: thermal: rcar-gen3-thermal: Add r8a779a0 support")
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Thanks for your patch!

> --- a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
> +++ b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml

> @@ -111,3 +121,20 @@ examples:
>                      };
>              };
>      };
> +  - |
> +    #include <dt-bindings/clock/r8a779a0-cpg-mssr.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    #include <dt-bindings/power/r8a779a0-sysc.h>
> +
> +    tsc_r8a779a0: thermal@e6190000 {
> +            compatible = "renesas,r8a779a0-thermal";
> +            reg = <0xe6190000 0x100>,

0x200, for all register blocks?

> +                  <0xe6198000 0x100>,
> +                  <0xe61a0000 0x100>,
> +                  <0xe61a8000 0x100>,
> +                  <0xe61b8000 0x100>;

0xe61b0000

> +            clocks = <&cpg CPG_MOD 919>;
> +            power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
> +            resets = <&cpg 919>;
> +            #thermal-sensor-cells = <1>;
> +    };

The rest looks good to me.

Gr{oetje,eeting}s,

                        Geert
Niklas Söderlund March 10, 2021, 10:55 a.m. UTC | #2
Hi Geert,

Thanks for your feedback.

On 2021-03-10 11:06:16 +0100, Geert Uytterhoeven wrote:
> Hi Niklas,
> 
> On Tue, Mar 9, 2021 at 5:24 PM Niklas Söderlund
> <niklas.soderlund+renesas@ragnatech.se> wrote:
> > When adding support for V3U (r8a779a0) it was incorrectly recorded it
> > supports four nodes, while in fact it supports five. The fifth node is
> > named TSC0 and breaks the existing naming schema starting at 1. Work
> > around this by separately defining the reg property for V3U and others.
> >
> > Restore the maximum number of nodes to three for other compatibles as
> > it was before erroneously increasing it for V3U.
> >
> > Fixes: d7fdfb6541f3be88 ("dt-bindings: thermal: rcar-gen3-thermal: Add r8a779a0 support")
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> 
> Thanks for your patch!
> 
> > --- a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
> > +++ b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
> 
> > @@ -111,3 +121,20 @@ examples:
> >                      };
> >              };
> >      };
> > +  - |
> > +    #include <dt-bindings/clock/r8a779a0-cpg-mssr.h>
> > +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> > +    #include <dt-bindings/power/r8a779a0-sysc.h>
> > +
> > +    tsc_r8a779a0: thermal@e6190000 {
> > +            compatible = "renesas,r8a779a0-thermal";
> > +            reg = <0xe6190000 0x100>,
> 
> 0x200, for all register blocks?

You are correct the V3U has more registers then previous SoCs but are 
not used (yet) by the driver, thanks for spotting this! Will respin this 
and the DTS.

> 
> > +                  <0xe6198000 0x100>,
> > +                  <0xe61a0000 0x100>,
> > +                  <0xe61a8000 0x100>,
> > +                  <0xe61b8000 0x100>;
> 
> 0xe61b0000
> 
> > +            clocks = <&cpg CPG_MOD 919>;
> > +            power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
> > +            resets = <&cpg 919>;
> > +            #thermal-sensor-cells = <1>;
> > +    };
> 
> The rest looks good to me.
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> -- 
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
index b33a76eeac4e4fed..4e51afcc42f21165 100644
--- a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
+++ b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
@@ -28,14 +28,7 @@  properties:
       - renesas,r8a77980-thermal # R-Car V3H
       - renesas,r8a779a0-thermal # R-Car V3U
 
-  reg:
-    minItems: 2
-    maxItems: 4
-    items:
-      - description: TSC1 registers
-      - description: TSC2 registers
-      - description: TSC3 registers
-      - description: TSC4 registers
+  reg: true
 
   interrupts:
     items:
@@ -71,8 +64,25 @@  if:
           enum:
             - renesas,r8a779a0-thermal
 then:
+  properties:
+    reg:
+      minItems: 2
+      maxItems: 3
+      items:
+        - description: TSC1 registers
+        - description: TSC2 registers
+        - description: TSC3 registers
   required:
     - interrupts
+else:
+  properties:
+    reg:
+      items:
+        - description: TSC0 registers
+        - description: TSC1 registers
+        - description: TSC2 registers
+        - description: TSC3 registers
+        - description: TSC4 registers
 
 additionalProperties: false
 
@@ -111,3 +121,20 @@  examples:
                     };
             };
     };
+  - |
+    #include <dt-bindings/clock/r8a779a0-cpg-mssr.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/power/r8a779a0-sysc.h>
+
+    tsc_r8a779a0: thermal@e6190000 {
+            compatible = "renesas,r8a779a0-thermal";
+            reg = <0xe6190000 0x100>,
+                  <0xe6198000 0x100>,
+                  <0xe61a0000 0x100>,
+                  <0xe61a8000 0x100>,
+                  <0xe61b8000 0x100>;
+            clocks = <&cpg CPG_MOD 919>;
+            power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+            resets = <&cpg 919>;
+            #thermal-sensor-cells = <1>;
+    };