[PATCH v2 02/10] ASoC: dt-bindings: audio-graph-port: add definitions/ports
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Wed Jan 18 01:08:40 CET 2023
Hi Rob
Thank for your feedback.
> > + ports:
> > + $ref: "#/definitions/port-base"
>
> This applies to 'port' nodes, but this is the 'ports' node.
>
> For example, this schema says you can have endpoint nodes directly under
> 'ports' which is not valid.
It is a little bit confusable, but "port-base" doesn't include "endpoint" (A).
It is the reason why audio-graph-port.yaml has patternProperties for endpoint (B),
if my understand was correct.
And user use audio-graph-port.yaml for "port" (C)
Thus, above doesn't indicate that "ports" can use direct "endpoint".
--- audio-graph-port.yaml ---
^ port-base:
| $ref: /schemas/graph.yaml#/$defs/port-base
| properties:
| convert-rate:
| $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate"
(A) convert-channels:
| $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels"
| convert-sample-format:
| $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-format"
| mclk-fs:
v $ref: "simple-card.yaml#/definitions/mclk-fs"
endpoint-base:
...
allOf:
(B) - $ref: "#/definitions/port-base" /* this doesn't include "endpoint" */
patternProperties:
(B) "^endpoint(@[0-9a-f]+)?":
$ref: "#/definitions/endpoint-base" /* "endpoint" is defined here */
unevaluatedProperties: false
-----------------------------
--- port user ----
port:
(C) $ref: audio-graph-port.yaml#
------------------
> But why do you need this? The graph.yaml schema should be sufficient
Sometimes Audio Graph Card/Card2 want to use "ports" not only "port".
People can use "audio-graph-card.yaml" as "port" today (C).
So we want to use similar style for *normal* "ports.
"ports" is defined under "definitions" (D), so there is no effect for normal
"port" user, I think.
--- port user ----
port:
(C) $ref: audio-graph-port.yaml#
------------------
--- ports user ---
ports:
(D) $ref: audio-graph-port.yaml#/definitions/ports
------------------
As I mentioned on git-log, *normal* ports user can use (D) style.
*custom* ports user can reuse "port-base" and "endpoint-base".
see below.
---- git log ---------------------------------------
If user needs standard "ports", it can use
ports:
$ref: audio-graph-port.yaml#/definitions/ports
If user want to use custom ports, it can re-use
audio-graph-port.yaml#/definitions/port-base"
audio-graph-port.yaml#/definitions/endpoint-base"
----------------------------------------------------
> because you aren't adding custom properties in 'ports'.
(snip)
> If 'ports' schema is applied to a DT, then its 'port' node(s) cannot
> have any additional properties. That defeats the point of patch 1.
Renesas Sound want to have custom "port", but sometimes it want to use
"ports" too. [08/10] patch customs both "ports" and "port".
Thank you for your help !!
Best regards
---
Kuninori Morimoto
More information about the Alsa-devel
mailing list