Re: yaml schema and sub-nodes with vendor prefixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 21, 2020 at 5:53 AM Lars-Peter Clausen <lars@xxxxxxxxxx> wrote:
>
> Hi,
>
> I'm trying to convert Xilinx XADC devicetree bindings[1] description to
> yaml format. And I'm running into issue with describing a sub-node with
> a vendor prefix.
>
> A typical devicetree entry for the XADC looks like
>
>      xadc@43200000 {
>          compatible = "xlnx,axi-xadc-1.00.a";
>
>          xlnx,channels {
>              #address-cells = <1>;
>              #size-cells = <0>;
>              channel@0 {
>                  reg = <0>;
>                  xlnx,bipolar;
>              };
>          };
>      };
>
> So there is the 'xlnx,channels' sub-node which contains a set of other
> nodes which represent the individual channels.
>
> The way I'm trying to describe it in the yaml file is like
>
>   xlnx,channels:
>      description: Node containing all the channel nodes
>      type: object
>      properties:
>        '#address-cells':
>           const: 1
>        '#size-cells':
>           const: 0
>
>      patternProperties:
>        "^channel@([0-9]|1[0-6])$":
>          type: object
>          properties:
>            reg:
>              description: ...
>            xlnx,bipolar:
>              description: If set the channel is used in bipolar mode.
>              type: boolean
>          required:
>            - reg
>          additionalProperties: false
>
>      required:
>        - '#address-cells'
>        - '#size-cells'
>      additionalProperties: false
>
> This now fails validation, presumably because there is no match in
> meta-schemas/vendor-props.yaml. If I drop the vendor prefix from the
> property name validation passes. I can also make validation pass by
> adding an arbitrary $ref property, but there is no 'node' type in
> types.yaml.
>
> What's the best way to describe a node with a vendor prefix?

Don't. Update the node name. Given there's only 1 child node, the
driver shouldn't really need to care what it called.

Rob



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux