Question about "xxx,yyy" style property
Rob Herring
robh at kernel.org
Thu Jul 2 15:54:38 CEST 2020
On Thu, May 28, 2020 at 8:41 PM Kuninori Morimoto
<kuninori.morimoto.gx at renesas.com> wrote:
>
>
> The Subject was "Re: [PATCH] ASoC: dt-bindings: simple-card: care missing address #address-cells"
>
> Hi Rob
>
> I'm trying to create v2 of simple-card patch,
> And got issue which I can't solve by myself.
>
> I think "xxx,yyy" (= which has "," at the property name)
> needs special care, but it is very un-understandable...
> Now, I'm give up.
> So, can I ask you 2 things about Yaml Doc "xxx,yyy" type property ?
>
> ========================
> 1) reference own definitions from "xxx,yyy"
> ========================
>
> I guess "xxx,yyy" naming property needs to has "description", right ?
>
> But, it is OK if it references "/schemas/xxxx"
>
> --- OK ------
> xxx,yyy:
> description: xxx
> $ref: /schemas/types.yaml#/definitions/phandle-array
> -------------
>
> but, will be error if it references own definitions
>
> --- NG ------
> xxx,yyy:
> description: xxx
> $ref: "#/definitions/mydef"
> -------------
>
> This is the related error
>
> -- error(?) --
> xxx.yaml: properties:xxx,yyy:\
> $ref: '#/definitions/mydef' does not match 'types.yaml#[/]{0,1}definitions/.*'
> --------------
>
> # but, there is no problem if it was defined as "patternProperties"
>
> Q. The "xxx,yyy" property can't references own definitions,
> or needs some magical extra settings ??
No, it can't. The problem with definitions is we can't really check
and do fixups on the definitions with the meta-schema.
> ========================
> 2) phandle for "xxx,yyy"
> ========================
>
> I noticed that it seems "xxx,yyy" property can't be referenced.
> Here, "xxx,yyy" has "type: object" and "additionalProperties: false"
> (below didn't happen if it doesn't have "additionalProperties: false")
>
> If "xxx,yyy" has phandle, but not referenced,
> This is not a problem.
>
> --- OK ---
> ...
> foo = <&bar>;
> ...
> xxx_yyy: xxx,yyy {
> ...
> };
> --------------
>
> But will be error if it is referenced.
>
> --- NG ---
> foo = <&xxx_yyy>;
> ...
> xxx_yyy: xxx,yyy {
> ...
> };
> ------------
>
> The error is
>
> -- error ---
> xxx.yaml: xxx.yyy: \
> Additional properties are not allowed ('phandle' was unexpected)
> ------------
>
> Q. The "xxx,yyy" needs magical settings to be referenced, or can't be ?
'phandle' (among other things) is automatically added by the tools. If
'xxx,yyy' is defined thru a 'definitions' then that fix-up is not
going to happen.
Rob
More information about the Alsa-devel
mailing list