diff mbox series

[v1,1/6] dt-bindings: gpio: realtek-otto: Add rtl9300 compatible

Message ID 7dfad6c63cea64ccd84907f1cf9f7c9c6d1ce3e9.1649533972.git.sander@svanheule.net
State Accepted
Commit 06a6a774f6b8ed94aefcf60caa56fe92d3a18e17
Headers show
Series Support for RTL930x/RTL931x GPIOs | expand

Commit Message

Sander Vanheule April 9, 2022, 7:55 p.m. UTC
Add the "realtek,rlt9300-gpio", "realtek,otto-gpio" compatible for GPIO
nodes on the RTL930x SoC series. This SoC requires an extra register
range, defining the interrupt CPU mapping registers.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
---
 .../bindings/gpio/realtek,otto-gpio.yaml      | 33 +++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

Comments

Krzysztof Kozlowski April 10, 2022, 2:16 p.m. UTC | #1
On 09/04/2022 21:55, Sander Vanheule wrote:
> Add the "realtek,rlt9300-gpio", "realtek,otto-gpio" compatible for GPIO
> nodes on the RTL930x SoC series. This SoC requires an extra register
> range, defining the interrupt CPU mapping registers.
> 
> Signed-off-by: Sander Vanheule <sander@svanheule.net>
> ---
>  .../bindings/gpio/realtek,otto-gpio.yaml      | 33 +++++++++++++++++--
>  1 file changed, 31 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
> index 100f20cebd76..3c511e9af377 100644
> --- a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
> +++ b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
> @@ -28,10 +28,10 @@ properties:
>        - enum:
>            - realtek,rtl8380-gpio
>            - realtek,rtl8390-gpio
> +          - realtek,rtl9300-gpio
>        - const: realtek,otto-gpio
>  
> -  reg:
> -    maxItems: 1
> +  reg: true
>  
>    "#gpio-cells":
>      const: 2
> @@ -50,6 +50,23 @@ properties:
>    interrupts:
>      maxItems: 1
>  
> +if:

You could put it under allOf:, so if you ever need to extend it, you
don't mess with the indentation, but it's fine as it is.


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof
Sander Vanheule April 10, 2022, 2:34 p.m. UTC | #2
Hi Krzysztof, 

On Sun, 2022-04-10 at 16:16 +0200, Krzysztof Kozlowski wrote:
> On 09/04/2022 21:55, Sander Vanheule wrote:
> > Add the "realtek,rlt9300-gpio", "realtek,otto-gpio" compatible for GPIO
> > nodes on the RTL930x SoC series. This SoC requires an extra register
> > range, defining the interrupt CPU mapping registers.
> > 
> > Signed-off-by: Sander Vanheule <sander@svanheule.net>
> > ---
> >  .../bindings/gpio/realtek,otto-gpio.yaml      | 33 +++++++++++++++++--
> >  1 file changed, 31 insertions(+), 2 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
> > b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
> > index 100f20cebd76..3c511e9af377 100644
> > --- a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
> > +++ b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
> > @@ -28,10 +28,10 @@ properties:
> >        - enum:
> >            - realtek,rtl8380-gpio
> >            - realtek,rtl8390-gpio
> > +          - realtek,rtl9300-gpio
> >        - const: realtek,otto-gpio
> >  
> > -  reg:
> > -    maxItems: 1
> > +  reg: true
> >  
> >    "#gpio-cells":
> >      const: 2
> > @@ -50,6 +50,23 @@ properties:
> >    interrupts:
> >      maxItems: 1
> >  
> > +if:
> 
> You could put it under allOf:, so if you ever need to extend it, you
> don't mess with the indentation, but it's fine as it is.
> 
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Thanks for the review. I'll probably need to send a v2 of the series, so I'll update the
indentation too. The commit messages have a typo ('rlt9300' and 'rlt9310') that needs to
be fixed anyway.

Best,
Sander
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
index 100f20cebd76..3c511e9af377 100644
--- a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
@@ -28,10 +28,10 @@  properties:
       - enum:
           - realtek,rtl8380-gpio
           - realtek,rtl8390-gpio
+          - realtek,rtl9300-gpio
       - const: realtek,otto-gpio
 
-  reg:
-    maxItems: 1
+  reg: true
 
   "#gpio-cells":
     const: 2
@@ -50,6 +50,23 @@  properties:
   interrupts:
     maxItems: 1
 
+if:
+  properties:
+    compatible:
+      contains:
+        const: realtek,rtl9300-gpio
+then:
+  properties:
+    reg:
+      items:
+        - description: GPIO and interrupt control
+        - description: interrupt CPU map
+else:
+  properties:
+    reg:
+      items:
+        - description: GPIO and interrupt control
+
 required:
   - compatible
   - reg
@@ -74,5 +91,17 @@  examples:
         interrupt-parent = <&rtlintc>;
         interrupts = <23>;
       };
+  - |
+      gpio@3300 {
+        compatible = "realtek,rtl9300-gpio", "realtek,otto-gpio";
+        reg = <0x3300 0x1c>, <0x3338 0x8>;
+        gpio-controller;
+        #gpio-cells = <2>;
+        ngpios = <24>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+        interrupt-parent = <&rtlintc>;
+        interrupts = <13>;
+      };
 
 ...