diff mbox series

[v3,1/4] dt-bindings: interrupt-controller: Add support for Amlogic A4 and A5 SoCs

Message ID 20250305-irqchip-gpio-a4-a5-v3-1-1eec70352fea@amlogic.com (mailing list archive)
State Superseded
Headers show
Series Add GPIO interrupt support for Amlogic A4 and A5 SoCs | expand

Commit Message

Xianwei Zhao via B4 Relay March 5, 2025, 10:02 a.m. UTC
From: Xianwei Zhao <xianwei.zhao@amlogic.com>

Update dt-binding document for GPIO interrupt controller
of Amlogic A4 and A5 SoCs

Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
 .../amlogic,meson-gpio-intc.yaml                    | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

Comments

Conor Dooley March 5, 2025, 4:28 p.m. UTC | #1
On Wed, Mar 05, 2025 at 06:02:56PM +0800, Xianwei Zhao via B4 Relay wrote:
> From: Xianwei Zhao <xianwei.zhao@amlogic.com>
> 
> Update dt-binding document for GPIO interrupt controller
> of Amlogic A4 and A5 SoCs
> 
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> ---
>  .../amlogic,meson-gpio-intc.yaml                    | 21 +++++++++++++++++++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
> index a93744763787..3c5853c71efa 100644
> --- a/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
> +++ b/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
> @@ -35,6 +35,9 @@ properties:
>                - amlogic,meson-sm1-gpio-intc
>                - amlogic,meson-a1-gpio-intc
>                - amlogic,meson-s4-gpio-intc
> +              - amlogic,a4-gpio-intc
> +              - amlogic,a4-gpio-ao-intc
> +              - amlogic,a5-gpio-intc
>                - amlogic,c3-gpio-intc
>                - amlogic,t7-gpio-intc
>            - const: amlogic,meson-gpio-intc
> @@ -49,8 +52,6 @@ properties:
>  
>    amlogic,channel-interrupts:
>      description: Array with the upstream hwirq numbers
> -    minItems: 8
> -    maxItems: 12

Please leave the widest constraints here, and let the more restricted
ones in your if/else below.

>      $ref: /schemas/types.yaml#/definitions/uint32-array
>  
>  required:
> @@ -60,6 +61,22 @@ required:
>    - "#interrupt-cells"
>    - amlogic,channel-interrupts
>  
> +if:
> +  properties:
> +    compatible:
> +      contains:
> +        const: amlogic,a4-gpio-ao-intc
> +then:
> +  properties:
> +    amlogic,channel-interrupts:
> +      minItems: 2
> +      maxItems: 12
> +else:
> +  properties:
> +    amlogic,channel-interrupts:
> +      minItems: 8
> +      maxItems: 12
> +
>  additionalProperties: false
>  
>  examples:
> 
> -- 
> 2.37.1
> 
>
Rob Herring March 5, 2025, 5:07 p.m. UTC | #2
On Wed, Mar 05, 2025 at 04:28:16PM +0000, Conor Dooley wrote:
> On Wed, Mar 05, 2025 at 06:02:56PM +0800, Xianwei Zhao via B4 Relay wrote:
> > From: Xianwei Zhao <xianwei.zhao@amlogic.com>
> > 
> > Update dt-binding document for GPIO interrupt controller
> > of Amlogic A4 and A5 SoCs
> > 
> > Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> > ---
> >  .../amlogic,meson-gpio-intc.yaml                    | 21 +++++++++++++++++++--
> >  1 file changed, 19 insertions(+), 2 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
> > index a93744763787..3c5853c71efa 100644
> > --- a/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
> > +++ b/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
> > @@ -35,6 +35,9 @@ properties:
> >                - amlogic,meson-sm1-gpio-intc
> >                - amlogic,meson-a1-gpio-intc
> >                - amlogic,meson-s4-gpio-intc
> > +              - amlogic,a4-gpio-intc
> > +              - amlogic,a4-gpio-ao-intc
> > +              - amlogic,a5-gpio-intc
> >                - amlogic,c3-gpio-intc
> >                - amlogic,t7-gpio-intc
> >            - const: amlogic,meson-gpio-intc
> > @@ -49,8 +52,6 @@ properties:
> >  
> >    amlogic,channel-interrupts:
> >      description: Array with the upstream hwirq numbers
> > -    minItems: 8
> > -    maxItems: 12
> 
> Please leave the widest constraints here, and let the more restricted
> ones in your if/else below.
> 
> >      $ref: /schemas/types.yaml#/definitions/uint32-array
> >  
> >  required:
> > @@ -60,6 +61,22 @@ required:
> >    - "#interrupt-cells"
> >    - amlogic,channel-interrupts
> >  
> > +if:
> > +  properties:
> > +    compatible:
> > +      contains:
> > +        const: amlogic,a4-gpio-ao-intc
> > +then:
> > +  properties:
> > +    amlogic,channel-interrupts:
> > +      minItems: 2
> > +      maxItems: 12

And then you don't need this clause as 2-12 is the full range.

> > +else:
> > +  properties:
> > +    amlogic,channel-interrupts:
> > +      minItems: 8
> > +      maxItems: 12

And 12 is already the max, so you only need 'minItems: 8'.

> > +
> >  additionalProperties: false
> >  
> >  examples:
> > 
> > -- 
> > 2.37.1
> > 
> >
Xianwei Zhao March 6, 2025, 8:48 a.m. UTC | #3
Hi Conor,
     Thanks for your advice.

On 2025/3/6 00:28, Conor Dooley wrote:
> On Wed, Mar 05, 2025 at 06:02:56PM +0800, Xianwei Zhao via B4 Relay wrote:
>> From: Xianwei Zhao<xianwei.zhao@amlogic.com>
>>
>> Update dt-binding document for GPIO interrupt controller
>> of Amlogic A4 and A5 SoCs
>>
>> Signed-off-by: Xianwei Zhao<xianwei.zhao@amlogic.com>
>> ---
>>   .../amlogic,meson-gpio-intc.yaml                    | 21 +++++++++++++++++++--
>>   1 file changed, 19 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
>> index a93744763787..3c5853c71efa 100644
>> --- a/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
>> +++ b/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
>> @@ -35,6 +35,9 @@ properties:
>>                 - amlogic,meson-sm1-gpio-intc
>>                 - amlogic,meson-a1-gpio-intc
>>                 - amlogic,meson-s4-gpio-intc
>> +              - amlogic,a4-gpio-intc
>> +              - amlogic,a4-gpio-ao-intc
>> +              - amlogic,a5-gpio-intc
>>                 - amlogic,c3-gpio-intc
>>                 - amlogic,t7-gpio-intc
>>             - const: amlogic,meson-gpio-intc
>> @@ -49,8 +52,6 @@ properties:
>>   
>>     amlogic,channel-interrupts:
>>       description: Array with the upstream hwirq numbers
>> -    minItems: 8
>> -    maxItems: 12
> Please leave the widest constraints here, and let the more restricted
> ones in your if/else below.
> 

Will do.

>>       $ref: /schemas/types.yaml#/definitions/uint32-array
>>   
>>   required:
>> @@ -60,6 +61,22 @@ required:
>>     - "#interrupt-cells"
>>     - amlogic,channel-interrupts
>>   
>> +if:
>> +  properties:
>> +    compatible:
>> +      contains:
>> +        const: amlogic,a4-gpio-ao-intc
>> +then:
>> +  properties:
>> +    amlogic,channel-interrupts:
>> +      minItems: 2
>> +      maxItems: 12
>> +else:
>> +  properties:
>> +    amlogic,channel-interrupts:
>> +      minItems: 8
>> +      maxItems: 12
>> +
>>   additionalProperties: false
>>   
>>   examples:
>>
>> -- 
>> 2.37.1
>>
>>
Xianwei Zhao March 6, 2025, 8:51 a.m. UTC | #4
Hi Rob,
    Thanks for your advice.

On 2025/3/6 01:07, Rob Herring wrote:
> [ EXTERNAL EMAIL ]
> 
> On Wed, Mar 05, 2025 at 04:28:16PM +0000, Conor Dooley wrote:
>> On Wed, Mar 05, 2025 at 06:02:56PM +0800, Xianwei Zhao via B4 Relay wrote:
>>> From: Xianwei Zhao <xianwei.zhao@amlogic.com>
>>>
>>> Update dt-binding document for GPIO interrupt controller
>>> of Amlogic A4 and A5 SoCs
>>>
>>> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
>>> ---
>>>   .../amlogic,meson-gpio-intc.yaml                    | 21 +++++++++++++++++++--
>>>   1 file changed, 19 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
>>> index a93744763787..3c5853c71efa 100644
>>> --- a/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
>>> +++ b/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
>>> @@ -35,6 +35,9 @@ properties:
>>>                 - amlogic,meson-sm1-gpio-intc
>>>                 - amlogic,meson-a1-gpio-intc
>>>                 - amlogic,meson-s4-gpio-intc
>>> +              - amlogic,a4-gpio-intc
>>> +              - amlogic,a4-gpio-ao-intc
>>> +              - amlogic,a5-gpio-intc
>>>                 - amlogic,c3-gpio-intc
>>>                 - amlogic,t7-gpio-intc
>>>             - const: amlogic,meson-gpio-intc
>>> @@ -49,8 +52,6 @@ properties:
>>>
>>>     amlogic,channel-interrupts:
>>>       description: Array with the upstream hwirq numbers
>>> -    minItems: 8
>>> -    maxItems: 12
>>
>> Please leave the widest constraints here, and let the more restricted
>> ones in your if/else below.
>>
>>>       $ref: /schemas/types.yaml#/definitions/uint32-array
>>>
>>>   required:
>>> @@ -60,6 +61,22 @@ required:
>>>     - "#interrupt-cells"
>>>     - amlogic,channel-interrupts
>>>
>>> +if:
>>> +  properties:
>>> +    compatible:
>>> +      contains:
>>> +        const: amlogic,a4-gpio-ao-intc
>>> +then:
>>> +  properties:
>>> +    amlogic,channel-interrupts:
>>> +      minItems: 2
>>> +      maxItems: 12
> 
> And then you don't need this clause as 2-12 is the full range.
> 

Indeed only 2. Will fix it.

>>> +else:
>>> +  properties:
>>> +    amlogic,channel-interrupts:
>>> +      minItems: 8
>>> +      maxItems: 12
> 
> And 12 is already the max, so you only need 'minItems: 8'.
> 

Will do.

>>> +
>>>   additionalProperties: false
>>>
>>>   examples:
>>>
>>> --
>>> 2.37.1
>>>
>>>
> 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
index a93744763787..3c5853c71efa 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
+++ b/Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.yaml
@@ -35,6 +35,9 @@  properties:
               - amlogic,meson-sm1-gpio-intc
               - amlogic,meson-a1-gpio-intc
               - amlogic,meson-s4-gpio-intc
+              - amlogic,a4-gpio-intc
+              - amlogic,a4-gpio-ao-intc
+              - amlogic,a5-gpio-intc
               - amlogic,c3-gpio-intc
               - amlogic,t7-gpio-intc
           - const: amlogic,meson-gpio-intc
@@ -49,8 +52,6 @@  properties:
 
   amlogic,channel-interrupts:
     description: Array with the upstream hwirq numbers
-    minItems: 8
-    maxItems: 12
     $ref: /schemas/types.yaml#/definitions/uint32-array
 
 required:
@@ -60,6 +61,22 @@  required:
   - "#interrupt-cells"
   - amlogic,channel-interrupts
 
+if:
+  properties:
+    compatible:
+      contains:
+        const: amlogic,a4-gpio-ao-intc
+then:
+  properties:
+    amlogic,channel-interrupts:
+      minItems: 2
+      maxItems: 12
+else:
+  properties:
+    amlogic,channel-interrupts:
+      minItems: 8
+      maxItems: 12
+
 additionalProperties: false
 
 examples: