From: Lars-Peter Clausen <lars@metafoo.de>
To: Rob Herring <robh+dt@kernel.org>,
Jonathan Cameron <jic23@kernel.org>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: yaml schema and sub-nodes with vendor prefixes
Date: Mon, 21 Sep 2020 12:26:31 +0200 [thread overview]
Message-ID: <b665f17d-0029-b51b-ac09-597f7b26d77b@metafoo.de> (raw)
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?
Thanks,
- Lars
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt
next reply other threads:[~2020-09-21 10:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-21 10:26 Lars-Peter Clausen [this message]
2020-10-06 20:19 ` yaml schema and sub-nodes with vendor prefixes Rob Herring
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=b665f17d-0029-b51b-ac09-597f7b26d77b@metafoo.de \
--to=lars@metafoo.de \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=robh+dt@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).