[v3,2/4] ASoC: dt-bindings: fsl,imx-asrc: update max interrupt numbers

Message ID 20240228-asrc_8qxp-v3-2-d4d5935fd3aa@nxp.com
State New
Headers
Series arm64: dts: imx8qxp add asrc and sai |

Commit Message

Frank Li Feb. 28, 2024, 7:14 p.m. UTC
  fsl,imx8qxp-spdif and fsl,imx8qm-spdif have 2 interrupts. Other platforms
have 1 interrupt.

Increase max interrupt number to 2 and add restriction for platforms except
i.MX8QXP and i.MX8QM.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 .../devicetree/bindings/sound/fsl,spdif.yaml         | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
  

Comments

Krzysztof Kozlowski Feb. 29, 2024, 9:44 a.m. UTC | #1
On 28/02/2024 20:14, Frank Li wrote:
> fsl,imx8qxp-spdif and fsl,imx8qm-spdif have 2 interrupts. Other platforms
> have 1 interrupt.
> 
> Increase max interrupt number to 2 and add restriction for platforms except
> i.MX8QXP and i.MX8QM.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  .../devicetree/bindings/sound/fsl,spdif.yaml         | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/fsl,spdif.yaml b/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
> index 82430f1d5e5a2..785f7997eea82 100644
> --- a/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
> +++ b/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
> @@ -31,7 +31,8 @@ properties:
>      maxItems: 1
>  
>    interrupts:
> -    maxItems: 1
> +    minItems: 1
> +    maxItems: 2
>  
>    dmas:
>      items:
> @@ -100,6 +101,23 @@ required:
>  
>  additionalProperties: false
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          enum:
> +            - fsl,imx35-spdif
> +            - fsl,vf610-spdif
> +            - fsl,imx6sx-spdif
> +            - fsl,imx8mq-spdif
> +            - fsl,imx8mm-spdif
> +            - fsl,imx8mn-spdif
> +            - fsl,imx8ulp-spdif
> +    then:
> +      properties:
> +        interrupts:
> +          maxItems: 1

else:
minItems: 2


Best regards,
Krzysztof
  
Frank Li March 1, 2024, 4:03 a.m. UTC | #2
On Thu, Feb 29, 2024 at 10:44:42AM +0100, Krzysztof Kozlowski wrote:
> On 28/02/2024 20:14, Frank Li wrote:
> > fsl,imx8qxp-spdif and fsl,imx8qm-spdif have 2 interrupts. Other platforms
> > have 1 interrupt.
> > 
> > Increase max interrupt number to 2 and add restriction for platforms except
> > i.MX8QXP and i.MX8QM.
> > 
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> >  .../devicetree/bindings/sound/fsl,spdif.yaml         | 20 +++++++++++++++++++-
> >  1 file changed, 19 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/sound/fsl,spdif.yaml b/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
> > index 82430f1d5e5a2..785f7997eea82 100644
> > --- a/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
> > +++ b/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
> > @@ -31,7 +31,8 @@ properties:
> >      maxItems: 1
> >  
> >    interrupts:
> > -    maxItems: 1
> > +    minItems: 1
> > +    maxItems: 2
> >  
> >    dmas:
> >      items:
> > @@ -100,6 +101,23 @@ required:
> >  
> >  additionalProperties: false
> >  
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          enum:
> > +            - fsl,imx35-spdif
> > +            - fsl,vf610-spdif
> > +            - fsl,imx6sx-spdif
> > +            - fsl,imx8mq-spdif
> > +            - fsl,imx8mm-spdif
> > +            - fsl,imx8mn-spdif
> > +            - fsl,imx8ulp-spdif
> > +    then:
> > +      properties:
> > +        interrupts:
> > +          maxItems: 1
> 
> else:
> minItems: 2

I think needn't 'else' here. Top have set to maxItems is 2. 

Frank

> 
> 
> Best regards,
> Krzysztof
>
  
Krzysztof Kozlowski March 1, 2024, 6:30 a.m. UTC | #3
On 01/03/2024 05:03, Frank Li wrote:
> On Thu, Feb 29, 2024 at 10:44:42AM +0100, Krzysztof Kozlowski wrote:
>> On 28/02/2024 20:14, Frank Li wrote:
>>> fsl,imx8qxp-spdif and fsl,imx8qm-spdif have 2 interrupts. Other platforms
>>> have 1 interrupt.
>>>
>>> Increase max interrupt number to 2 and add restriction for platforms except
>>> i.MX8QXP and i.MX8QM.
>>>
>>> Signed-off-by: Frank Li <Frank.Li@nxp.com>
>>> ---
>>>  .../devicetree/bindings/sound/fsl,spdif.yaml         | 20 +++++++++++++++++++-
>>>  1 file changed, 19 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/sound/fsl,spdif.yaml b/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
>>> index 82430f1d5e5a2..785f7997eea82 100644
>>> --- a/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
>>> +++ b/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
>>> @@ -31,7 +31,8 @@ properties:
>>>      maxItems: 1
>>>  
>>>    interrupts:
>>> -    maxItems: 1
>>> +    minItems: 1
>>> +    maxItems: 2
>>>  
>>>    dmas:
>>>      items:
>>> @@ -100,6 +101,23 @@ required:
>>>  
>>>  additionalProperties: false
>>>  
>>> +allOf:
>>> +  - if:
>>> +      properties:
>>> +        compatible:
>>> +          enum:
>>> +            - fsl,imx35-spdif
>>> +            - fsl,vf610-spdif
>>> +            - fsl,imx6sx-spdif
>>> +            - fsl,imx8mq-spdif
>>> +            - fsl,imx8mm-spdif
>>> +            - fsl,imx8mn-spdif
>>> +            - fsl,imx8ulp-spdif
>>> +    then:
>>> +      properties:
>>> +        interrupts:
>>> +          maxItems: 1
>>
>> else:
>> minItems: 2
> 
> I think needn't 'else' here. Top have set to maxItems is 2. 

So explain why one item is correct here.


Best regards,
Krzysztof
  
Frank Li March 1, 2024, 3:39 p.m. UTC | #4
On Fri, Mar 01, 2024 at 07:30:45AM +0100, Krzysztof Kozlowski wrote:
> On 01/03/2024 05:03, Frank Li wrote:
> > On Thu, Feb 29, 2024 at 10:44:42AM +0100, Krzysztof Kozlowski wrote:
> >> On 28/02/2024 20:14, Frank Li wrote:
> >>> fsl,imx8qxp-spdif and fsl,imx8qm-spdif have 2 interrupts. Other platforms
> >>> have 1 interrupt.
> >>>
> >>> Increase max interrupt number to 2 and add restriction for platforms except
> >>> i.MX8QXP and i.MX8QM.
> >>>
> >>> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> >>> ---
> >>>  .../devicetree/bindings/sound/fsl,spdif.yaml         | 20 +++++++++++++++++++-
> >>>  1 file changed, 19 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/sound/fsl,spdif.yaml b/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
> >>> index 82430f1d5e5a2..785f7997eea82 100644
> >>> --- a/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
> >>> +++ b/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
> >>> @@ -31,7 +31,8 @@ properties:
> >>>      maxItems: 1
> >>>  
> >>>    interrupts:
> >>> -    maxItems: 1
> >>> +    minItems: 1
> >>> +    maxItems: 2
> >>>  
> >>>    dmas:
> >>>      items:
> >>> @@ -100,6 +101,23 @@ required:
> >>>  
> >>>  additionalProperties: false
> >>>  
> >>> +allOf:
> >>> +  - if:
> >>> +      properties:
> >>> +        compatible:
> >>> +          enum:
> >>> +            - fsl,imx35-spdif
> >>> +            - fsl,vf610-spdif
> >>> +            - fsl,imx6sx-spdif
> >>> +            - fsl,imx8mq-spdif
> >>> +            - fsl,imx8mm-spdif
> >>> +            - fsl,imx8mn-spdif
> >>> +            - fsl,imx8ulp-spdif
> >>> +    then:
> >>> +      properties:
> >>> +        interrupts:
> >>> +          maxItems: 1
> >>
> >> else:
> >> minItems: 2
> > 
> > I think needn't 'else' here. Top have set to maxItems is 2. 
> 
> So explain why one item is correct here.

Top interrupt: maxItems: 2. That's means all compatible string (include
imx8qxp, and imx8qm) required interrrupt number less than 2.

other compatible string (except imx8qxp and imx8qm) already listed in
'enum', have additional requirement <= 1, which match original requirement.

simple said:

set[all] <=2
set[fsl,imx35-spdif...] <= 1

So it is the same as

set [all] <= 2
set [fsl,imx35-spdif..] <=1
set [qxp, qm] <= 2

> 
> 
> Best regards,
> Krzysztof
>
  
Rob Herring March 4, 2024, 2:56 p.m. UTC | #5
On Fri, Mar 01, 2024 at 10:39:43AM -0500, Frank Li wrote:
> On Fri, Mar 01, 2024 at 07:30:45AM +0100, Krzysztof Kozlowski wrote:
> > On 01/03/2024 05:03, Frank Li wrote:
> > > On Thu, Feb 29, 2024 at 10:44:42AM +0100, Krzysztof Kozlowski wrote:
> > >> On 28/02/2024 20:14, Frank Li wrote:
> > >>> fsl,imx8qxp-spdif and fsl,imx8qm-spdif have 2 interrupts. Other platforms
> > >>> have 1 interrupt.
> > >>>
> > >>> Increase max interrupt number to 2 and add restriction for platforms except
> > >>> i.MX8QXP and i.MX8QM.
> > >>>
> > >>> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > >>> ---
> > >>>  .../devicetree/bindings/sound/fsl,spdif.yaml         | 20 +++++++++++++++++++-
> > >>>  1 file changed, 19 insertions(+), 1 deletion(-)
> > >>>
> > >>> diff --git a/Documentation/devicetree/bindings/sound/fsl,spdif.yaml b/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
> > >>> index 82430f1d5e5a2..785f7997eea82 100644
> > >>> --- a/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
> > >>> +++ b/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
> > >>> @@ -31,7 +31,8 @@ properties:
> > >>>      maxItems: 1
> > >>>  
> > >>>    interrupts:
> > >>> -    maxItems: 1
> > >>> +    minItems: 1
> > >>> +    maxItems: 2
> > >>>  
> > >>>    dmas:
> > >>>      items:
> > >>> @@ -100,6 +101,23 @@ required:
> > >>>  
> > >>>  additionalProperties: false
> > >>>  
> > >>> +allOf:
> > >>> +  - if:
> > >>> +      properties:
> > >>> +        compatible:
> > >>> +          enum:
> > >>> +            - fsl,imx35-spdif
> > >>> +            - fsl,vf610-spdif
> > >>> +            - fsl,imx6sx-spdif
> > >>> +            - fsl,imx8mq-spdif
> > >>> +            - fsl,imx8mm-spdif
> > >>> +            - fsl,imx8mn-spdif
> > >>> +            - fsl,imx8ulp-spdif
> > >>> +    then:
> > >>> +      properties:
> > >>> +        interrupts:
> > >>> +          maxItems: 1
> > >>
> > >> else:
> > >> minItems: 2
> > > 
> > > I think needn't 'else' here. Top have set to maxItems is 2. 
> > 
> > So explain why one item is correct here.
> 
> Top interrupt: maxItems: 2. That's means all compatible string (include
> imx8qxp, and imx8qm) required interrrupt number less than 2.

You said: "fsl,imx8qxp-spdif and fsl,imx8qm-spdif have 2 interrupts"

That means they have *exactly* 2 interrupts, not <= 2 interrupts. The 
top level says you have 1 or 2. Somewhere you have to say it's always 2 
interrupts which is what Krzysztof provided.

Or you need to explain why the 2nd interrupt is optional for 
fsl,imx8qxp-spdif and fsl,imx8qm-spdif.

Actually, I'd reverse the if/then to have shorter list:

if:
  properties:
    compatible:
      enum:
        - fsl,imx8qm-spdif
        - fsl,imx8qxp-spdif
then:
  properties:
    interrupts:
      minItems: 2
else:
  properties:
    interrupts:
      maxItems: 1


Rob
  

Patch

diff --git a/Documentation/devicetree/bindings/sound/fsl,spdif.yaml b/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
index 82430f1d5e5a2..785f7997eea82 100644
--- a/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
+++ b/Documentation/devicetree/bindings/sound/fsl,spdif.yaml
@@ -31,7 +31,8 @@  properties:
     maxItems: 1
 
   interrupts:
-    maxItems: 1
+    minItems: 1
+    maxItems: 2
 
   dmas:
     items:
@@ -100,6 +101,23 @@  required:
 
 additionalProperties: false
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          enum:
+            - fsl,imx35-spdif
+            - fsl,vf610-spdif
+            - fsl,imx6sx-spdif
+            - fsl,imx8mq-spdif
+            - fsl,imx8mm-spdif
+            - fsl,imx8mn-spdif
+            - fsl,imx8ulp-spdif
+    then:
+      properties:
+        interrupts:
+          maxItems: 1
+
 examples:
   - |
     spdif@2004000 {