diff mbox series

[1/3] ASoC: dt-bindings: fsl,xcvr: Adjust the number of interrupts

Message ID 1719291415-1168-2-git-send-email-shengjiu.wang@nxp.com (mailing list archive)
State New, archived
Headers show
Series arm64: dts: imx8mp: add audio XCVR sound card | expand

Commit Message

Shengjiu Wang June 25, 2024, 4:56 a.m. UTC
On i.MX8MP, there are 3 interrupts, the third interrupt is
SPDIF wakeup interrupt from PHY

Add ref: dai-common.yaml for #sound-dai-cells is needed and
XCVR is a DAI device.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 Documentation/devicetree/bindings/sound/fsl,xcvr.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Krzysztof Kozlowski June 26, 2024, 9:22 a.m. UTC | #1
On 25/06/2024 06:56, Shengjiu Wang wrote:
> On i.MX8MP, there are 3 interrupts, the third interrupt is
> SPDIF wakeup interrupt from PHY
> 
> Add ref: dai-common.yaml for #sound-dai-cells is needed and
> XCVR is a DAI device.
> 
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> ---
>  Documentation/devicetree/bindings/sound/fsl,xcvr.yaml | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml b/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
> index 197ae8ba9c30..7470866e11c6 100644
> --- a/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
> +++ b/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
> @@ -42,6 +42,7 @@ properties:
>      items:
>        - description: WAKEUPMIX Audio XCVR Interrupt 1
>        - description: WAKEUPMIX Audio XCVR Interrupt 2
> +      - description: SPDIF wakeup interrupt from PHY
>      minItems: 1
>  
>    clocks:
> @@ -88,6 +89,7 @@ required:
>    - dma-names
>  
>  allOf:
> +  - $ref: dai-common.yaml#
>    - if:
>        properties:
>          compatible:
> @@ -112,7 +114,7 @@ allOf:
>      else:
>        properties:
>          interrupts:
> -          maxItems: 1
> +          maxItems: 3

I have doubts this was tested. The existing example should fail,
although I did not see any reports. Not sure why.

Best regards,
Krzysztof
Shengjiu Wang June 26, 2024, 9:25 a.m. UTC | #2
On Wed, Jun 26, 2024 at 5:23 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 25/06/2024 06:56, Shengjiu Wang wrote:
> > On i.MX8MP, there are 3 interrupts, the third interrupt is
> > SPDIF wakeup interrupt from PHY
> >
> > Add ref: dai-common.yaml for #sound-dai-cells is needed and
> > XCVR is a DAI device.
> >
> > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> > ---
> >  Documentation/devicetree/bindings/sound/fsl,xcvr.yaml | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml b/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
> > index 197ae8ba9c30..7470866e11c6 100644
> > --- a/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
> > +++ b/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
> > @@ -42,6 +42,7 @@ properties:
> >      items:
> >        - description: WAKEUPMIX Audio XCVR Interrupt 1
> >        - description: WAKEUPMIX Audio XCVR Interrupt 2
> > +      - description: SPDIF wakeup interrupt from PHY
> >      minItems: 1
> >
> >    clocks:
> > @@ -88,6 +89,7 @@ required:
> >    - dma-names
> >
> >  allOf:
> > +  - $ref: dai-common.yaml#
> >    - if:
> >        properties:
> >          compatible:
> > @@ -112,7 +114,7 @@ allOf:
> >      else:
> >        properties:
> >          interrupts:
> > -          maxItems: 1
> > +          maxItems: 3
>
> I have doubts this was tested. The existing example should fail,
> although I did not see any reports. Not sure why.

it is tested, because the minItems is 1. so the example can pass

Best regards
Shengjiu Wang
>
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski June 26, 2024, 9:34 a.m. UTC | #3
On 26/06/2024 11:25, Shengjiu Wang wrote:
> On Wed, Jun 26, 2024 at 5:23 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>
>> On 25/06/2024 06:56, Shengjiu Wang wrote:
>>> On i.MX8MP, there are 3 interrupts, the third interrupt is
>>> SPDIF wakeup interrupt from PHY
>>>
>>> Add ref: dai-common.yaml for #sound-dai-cells is needed and
>>> XCVR is a DAI device.
>>>
>>> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
>>> ---
>>>  Documentation/devicetree/bindings/sound/fsl,xcvr.yaml | 6 ++++--
>>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml b/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
>>> index 197ae8ba9c30..7470866e11c6 100644
>>> --- a/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
>>> +++ b/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
>>> @@ -42,6 +42,7 @@ properties:
>>>      items:
>>>        - description: WAKEUPMIX Audio XCVR Interrupt 1
>>>        - description: WAKEUPMIX Audio XCVR Interrupt 2
>>> +      - description: SPDIF wakeup interrupt from PHY
>>>      minItems: 1
>>>
>>>    clocks:
>>> @@ -88,6 +89,7 @@ required:
>>>    - dma-names
>>>
>>>  allOf:
>>> +  - $ref: dai-common.yaml#
>>>    - if:
>>>        properties:
>>>          compatible:
>>> @@ -112,7 +114,7 @@ allOf:
>>>      else:
>>>        properties:
>>>          interrupts:
>>> -          maxItems: 1
>>> +          maxItems: 3
>>
>> I have doubts this was tested. The existing example should fail,
>> although I did not see any reports. Not sure why.
> 
> it is tested, because the minItems is 1. so the example can pass
> 

That's a very unexpected change in dtschema. It indeed passes, but is
not correct. Why interrupts are flexible? This should be constrained.
Let's wait for Rob's confirmation that this is not a bug in dtschema.

Anyway, update example to be complete in next version.

Best regards,
Krzysztof
Krzysztof Kozlowski June 26, 2024, 1:35 p.m. UTC | #4
On 26/06/2024 11:34, Krzysztof Kozlowski wrote:
>>>>      items:
>>>>        - description: WAKEUPMIX Audio XCVR Interrupt 1
>>>>        - description: WAKEUPMIX Audio XCVR Interrupt 2
>>>> +      - description: SPDIF wakeup interrupt from PHY
>>>>      minItems: 1
>>>>
>>>>    clocks:
>>>> @@ -88,6 +89,7 @@ required:
>>>>    - dma-names
>>>>
>>>>  allOf:
>>>> +  - $ref: dai-common.yaml#
>>>>    - if:
>>>>        properties:
>>>>          compatible:
>>>> @@ -112,7 +114,7 @@ allOf:
>>>>      else:
>>>>        properties:
>>>>          interrupts:
>>>> -          maxItems: 1
>>>> +          maxItems: 3
>>>
>>> I have doubts this was tested. The existing example should fail,
>>> although I did not see any reports. Not sure why.
>>
>> it is tested, because the minItems is 1. so the example can pass
>>
> 
> That's a very unexpected change in dtschema. It indeed passes, but is
> not correct. Why interrupts are flexible? This should be constrained.
> Let's wait for Rob's confirmation that this is not a bug in dtschema.

Yep we need here minItems as well, so this is strictly constrained or
please explain why this should be flexible.


Best regards,
Krzysztof
Shengjiu Wang June 27, 2024, 2:14 a.m. UTC | #5
On Wed, Jun 26, 2024 at 9:35 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 26/06/2024 11:34, Krzysztof Kozlowski wrote:
> >>>>      items:
> >>>>        - description: WAKEUPMIX Audio XCVR Interrupt 1
> >>>>        - description: WAKEUPMIX Audio XCVR Interrupt 2
> >>>> +      - description: SPDIF wakeup interrupt from PHY
> >>>>      minItems: 1
> >>>>
> >>>>    clocks:
> >>>> @@ -88,6 +89,7 @@ required:
> >>>>    - dma-names
> >>>>
> >>>>  allOf:
> >>>> +  - $ref: dai-common.yaml#
> >>>>    - if:
> >>>>        properties:
> >>>>          compatible:
> >>>> @@ -112,7 +114,7 @@ allOf:
> >>>>      else:
> >>>>        properties:
> >>>>          interrupts:
> >>>> -          maxItems: 1
> >>>> +          maxItems: 3
> >>>
> >>> I have doubts this was tested. The existing example should fail,
> >>> although I did not see any reports. Not sure why.
> >>
> >> it is tested, because the minItems is 1. so the example can pass
> >>
> >
> > That's a very unexpected change in dtschema. It indeed passes, but is
> > not correct. Why interrupts are flexible? This should be constrained.
> > Let's wait for Rob's confirmation that this is not a bug in dtschema.
>
> Yep we need here minItems as well, so this is strictly constrained or
> please explain why this should be flexible.
>
Ok, will add minitems:3 here, and update example.

Best regards
Shengjiu Wang
>
> Best regards,
> Krzysztof
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml b/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
index 197ae8ba9c30..7470866e11c6 100644
--- a/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
+++ b/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
@@ -42,6 +42,7 @@  properties:
     items:
       - description: WAKEUPMIX Audio XCVR Interrupt 1
       - description: WAKEUPMIX Audio XCVR Interrupt 2
+      - description: SPDIF wakeup interrupt from PHY
     minItems: 1
 
   clocks:
@@ -88,6 +89,7 @@  required:
   - dma-names
 
 allOf:
+  - $ref: dai-common.yaml#
   - if:
       properties:
         compatible:
@@ -112,7 +114,7 @@  allOf:
     else:
       properties:
         interrupts:
-          maxItems: 1
+          maxItems: 3
 
   - if:
       properties:
@@ -128,7 +130,7 @@  allOf:
         clock-names:
           maxItems: 4
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |