devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh+dt@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jonathan Cameron <jic23@kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: yaml schema and sub-nodes with vendor prefixes
Date: Tue, 6 Oct 2020 15:19:56 -0500	[thread overview]
Message-ID: <CAL_JsqK=VnTUMztHvhNaz6xn3wDsUD4jyYoRYvNEYZGTagKDow@mail.gmail.com> (raw)
In-Reply-To: <b665f17d-0029-b51b-ac09-597f7b26d77b@metafoo.de>

On Mon, Sep 21, 2020 at 5:53 AM Lars-Peter Clausen <lars@metafoo.de> 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

      reply	other threads:[~2020-10-06 20:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21 10:26 yaml schema and sub-nodes with vendor prefixes Lars-Peter Clausen
2020-10-06 20:19 ` Rob Herring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAL_JsqK=VnTUMztHvhNaz6xn3wDsUD4jyYoRYvNEYZGTagKDow@mail.gmail.com' \
    --to=robh+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).