diff mbox series

[v2,1/2] dt-bindings: watchdog: renesas,wdt: Add r9a09g011 (RZ/V2M) support

Message ID 20220613150550.70334-2-phil.edworthy@renesas.com
State Superseded
Headers show
Series arm64: renesas: Add RZ/V2M watchdog support | expand

Commit Message

Phil Edworthy June 13, 2022, 3:05 p.m. UTC
Add the documentation for the r9a09g011 SoC, but in doing so also
reorganise the doc to make it easier to read.
Additionally, make the binding require an interrupt to be specified.
Whilst the driver does not need an interrupt, all of the SoCs that use
this binding actually provide one.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v2:
 - Added minItems for interrupt-names and clock-names
---
 .../bindings/watchdog/renesas,wdt.yaml        | 71 ++++++++++++-------
 1 file changed, 47 insertions(+), 24 deletions(-)

Comments

Rob Herring June 17, 2022, 10:56 p.m. UTC | #1
On Mon, 13 Jun 2022 16:05:49 +0100, Phil Edworthy wrote:
> Add the documentation for the r9a09g011 SoC, but in doing so also
> reorganise the doc to make it easier to read.
> Additionally, make the binding require an interrupt to be specified.
> Whilst the driver does not need an interrupt, all of the SoCs that use
> this binding actually provide one.
> 
> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v2:
>  - Added minItems for interrupt-names and clock-names
> ---
>  .../bindings/watchdog/renesas,wdt.yaml        | 71 ++++++++++++-------
>  1 file changed, 47 insertions(+), 24 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Geert Uytterhoeven June 20, 2022, 7:14 a.m. UTC | #2
Hi Phil,

On Mon, Jun 13, 2022 at 5:06 PM Phil Edworthy <phil.edworthy@renesas.com> wrote:
> Add the documentation for the r9a09g011 SoC, but in doing so also
> reorganise the doc to make it easier to read.
> Additionally, make the binding require an interrupt to be specified.
> Whilst the driver does not need an interrupt, all of the SoCs that use
> this binding actually provide one.
>
> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v2:
>  - Added minItems for interrupt-names and clock-names

Thanks for the update!

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

One minor nit: you have lost the check that there is only one interrupt
on e.g. R-Car H3, so "make dtbs_check" no longer complains if I add
a second interrupt to the wdt node in r8a77951.dtsi.

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
Phil Edworthy June 20, 2022, 8 a.m. UTC | #3
Hi Geert,

On 20 June 2022 08:14 Geert Uytterhoeven wrote:
> On Mon, Jun 13, 2022 at 5:06 PM Phil Edworthy wrote:
> > Add the documentation for the r9a09g011 SoC, but in doing so also
> > reorganise the doc to make it easier to read.
> > Additionally, make the binding require an interrupt to be specified.
> > Whilst the driver does not need an interrupt, all of the SoCs that use
> > this binding actually provide one.
> >
> > Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> > Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v2:
> >  - Added minItems for interrupt-names and clock-names
> 
> Thanks for the update!
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> One minor nit: you have lost the check that there is only one interrupt
> on e.g. R-Car H3, so "make dtbs_check" no longer complains if I add
> a second interrupt to the wdt node in r8a77951.dtsi.
Ah, right, same for clocks.
I'll add an else with maxItems:1 for these

Thanks
Phil
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
index a8d7dde5271b..7bb6ca6af882 100644
--- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
@@ -31,6 +31,11 @@  properties:
               - renesas,r9a07g054-wdt    # RZ/V2L
           - const: renesas,rzg2l-wdt
 
+      - items:
+          - enum:
+              - renesas,r9a09g011-wdt    # RZ/V2M
+          - const: renesas,rzv2m-wdt     # RZ/V2M
+
       - items:
           - enum:
               - renesas,r8a7742-wdt      # RZ/G1H
@@ -70,13 +75,29 @@  properties:
   reg:
     maxItems: 1
 
-  interrupts: true
-
-  interrupt-names: true
-
-  clocks: true
-
-  clock-names: true
+  interrupts:
+    minItems: 1
+    items:
+      - description: Timeout
+      - description: Parity error
+
+  interrupt-names:
+    minItems: 1
+    items:
+      - const: wdt
+      - const: perrout
+
+  clocks:
+    minItems: 1
+    items:
+      - description: Register access clock
+      - description: Main clock
+
+  clock-names:
+    minItems: 1
+    items:
+      - const: pclk
+      - const: oscclk
 
   power-domains:
     maxItems: 1
@@ -89,6 +110,7 @@  properties:
 required:
   - compatible
   - reg
+  - interrupts
   - clocks
 
 allOf:
@@ -113,31 +135,30 @@  allOf:
           contains:
             enum:
               - renesas,rzg2l-wdt
+              - renesas,rzv2m-wdt
     then:
       properties:
-        interrupts:
-          maxItems: 2
-        interrupt-names:
-          items:
-            - const: wdt
-            - const: perrout
         clocks:
-          items:
-            - description: Register access clock
-            - description: Main clock
+          minItems: 2
         clock-names:
-          items:
-            - const: pclk
-            - const: oscclk
+          minItems: 2
       required:
         - clock-names
-        - interrupt-names
-    else:
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - renesas,rzg2l-wdt
+    then:
       properties:
         interrupts:
-          maxItems: 1
-        clocks:
-          maxItems: 1
+          minItems: 2
+        interrupt-names:
+          minItems: 2
+      required:
+        - interrupt-names
 
 additionalProperties: false
 
@@ -145,9 +166,11 @@  examples:
   - |
     #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
     #include <dt-bindings/power/r8a7795-sysc.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
     wdt0: watchdog@e6020000 {
             compatible = "renesas,r8a7795-wdt", "renesas,rcar-gen3-wdt";
             reg = <0xe6020000 0x0c>;
+            interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
             clocks = <&cpg CPG_MOD 402>;
             power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
             resets = <&cpg 402>;