diff mbox series

[04/11] ASoC: dt-bindings: audio-graph-port: add clocks on endpoint

Message ID 87pmcmpyml.wl-kuninori.morimoto.gx@renesas.com
State Superseded
Headers show
Series ASoC: dt-bindings: audio-graph-port related update | expand

Commit Message

Kuninori Morimoto Dec. 14, 2022, 1:22 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Audio Graph endpoint is possible to have clock, but it is
missing its releated properties on audio-graph-port.
It is already defined on simple-card.
This patch adds it. Without this patch, we will get below warning

${LINUX}/arch/arm64/boot/dts/renesas/r8a77950-ulcb-kf.dtb: audio-codec@44: ports:port@0:endpoint: Unevaluated properties are not allowed ('clocks' was unexpected)
	From schema: ${LINUX}/Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 .../devicetree/bindings/sound/audio-graph-port.yaml      | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Rob Herring Dec. 16, 2022, 4:20 p.m. UTC | #1
On Wed, Dec 14, 2022 at 01:22:58AM +0000, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> Audio Graph endpoint is possible to have clock, but it is
> missing its releated properties on audio-graph-port.
> It is already defined on simple-card.
> This patch adds it. Without this patch, we will get below warning
> 
> ${LINUX}/arch/arm64/boot/dts/renesas/r8a77950-ulcb-kf.dtb: audio-codec@44: ports:port@0:endpoint: Unevaluated properties are not allowed ('clocks' was unexpected)
> 	From schema: ${LINUX}/Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  .../devicetree/bindings/sound/audio-graph-port.yaml      | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml
> index 25f7204c7c4a..37c20cc8dc36 100644
> --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml
> +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml
> @@ -48,6 +48,15 @@ definitions:
>          oneOf:
>            - $ref: /schemas/types.yaml#/definitions/flag
>            - $ref: /schemas/types.yaml#/definitions/phandle
> +      clocks:
> +        description: Indicates system clock
> +        $ref: /schemas/types.yaml#/definitions/phandle

Is this the standard 'clocks' or you defined your own. Because 'clocks' 
is not a 'phandle'. It's a phandle+args.

I don't think we should have 'clocks' in endpoint nodes. Or at least we 
don't want to endorse more cases of it. The graph describes data 
connections. The only properties on endpoints are properties of that 
connection. An endpoint can't really consume a clock.

> +      system-clock-frequency:
> +        $ref: "simple-card.yaml#/definitions/system-clock-frequency"
> +      system-clock-direction-out:
> +        $ref: "simple-card.yaml#/definitions/system-clock-direction-out"
> +      system-clock-fixed:
> +        $ref: "simple-card.yaml#/definitions/system-clock-fixed"

We have standard clock bindings. Whatever you need here should use that 
instead.

>  
>        dai-format:
>          description: audio format.
> -- 
> 2.25.1
> 
>
Kuninori Morimoto Dec. 18, 2022, 11:47 p.m. UTC | #2
Hi Rob

Thank you for your feedback

> > +      clocks:
> > +        description: Indicates system clock
> > +        $ref: /schemas/types.yaml#/definitions/phandle
>
> Is this the standard 'clocks' or you defined your own. Because 'clocks' 
> is not a 'phandle'. It's a phandle+args.

Thanks. I will fix it.

> I don't think we should have 'clocks' in endpoint nodes. Or at least we 
> don't want to endorse more cases of it. The graph describes data 
> connections. The only properties on endpoints are properties of that 
> connection. An endpoint can't really consume a clock.

Hmmm.. but, it is already implemented.

> > +      system-clock-frequency:
> > +        $ref: "simple-card.yaml#/definitions/system-clock-frequency"
> > +      system-clock-direction-out:
> > +        $ref: "simple-card.yaml#/definitions/system-clock-direction-out"
> > +      system-clock-fixed:
> > +        $ref: "simple-card.yaml#/definitions/system-clock-fixed"
(snip)
> We have standard clock bindings. Whatever you need here should use that 
> instead.

Audio-Graph-Card and Simple-Audio-Card/Card2 are sharing the code.
So, simple-card.yaml is using "definitions" to sharing it.
We can avoid duplicate definition ?


Thank you for your help !!

Best regards
---
Kuninori Morimoto
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml
index 25f7204c7c4a..37c20cc8dc36 100644
--- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml
+++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml
@@ -48,6 +48,15 @@  definitions:
         oneOf:
           - $ref: /schemas/types.yaml#/definitions/flag
           - $ref: /schemas/types.yaml#/definitions/phandle
+      clocks:
+        description: Indicates system clock
+        $ref: /schemas/types.yaml#/definitions/phandle
+      system-clock-frequency:
+        $ref: "simple-card.yaml#/definitions/system-clock-frequency"
+      system-clock-direction-out:
+        $ref: "simple-card.yaml#/definitions/system-clock-direction-out"
+      system-clock-fixed:
+        $ref: "simple-card.yaml#/definitions/system-clock-fixed"
 
       dai-format:
         description: audio format.