devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: DTML <devicetree@vger.kernel.org>
Subject: Re: DT schemas for multi-transport bindings
Date: Wed, 30 Oct 2019 08:19:36 -0500	[thread overview]
Message-ID: <20191030131936.GA26946@bogus> (raw)
In-Reply-To: <CAKdAkRQNrDGWFOcoVTfjMS25E4JqSFs98yOQ8_1q7V612az_0A@mail.gmail.com>

On Fri, Oct 25, 2019 at 01:43:33PM -0700, Dmitry Torokhov wrote:
> Hi Rob,
> 
> I am trying to wrap my mind around converting multi-transport bindings
> (let's say TSC2004/5 controller which is pretty much the same part, but
> one is I2C while another is SPI interface). There is a set of common
> properties, and then we can have transport-specific ones (for example,
> spi-max-frequency for SPI case). 

I'm pretty sure we already have some examples of this.

You could have 3 files with common props, i2c props, and spi props, but 
that's probably an overkill. I'd just list all the possible properties 
in one file and then they can be made conditional as needed.

For bus properties you really only need to list them if required or you 
have additional constraints.

> Is it possible to annotate that some
> properties are only needed for certain compatible, similarly to how
> patternProperties work (but instead of matching node name we'd match on
> compatible)?

Yes, with if/then schema. There's numerous examples of this. It's a 
little more verbose than I'd like, but that's because generally each 
property schema is independent.


> Also, from syntax POV, how do I reference file ooutside of current
> directory? I.e. how do I reference .../spi/spi-controller.yaml from
> .../input/touchscreen/tsc2005.yaml?

You don't. TSC2005 is not a SPI controller/master. Every SPI controller 
should reference spi-controller.yaml and that defines the bus structure 
and allowed SPI bus properties in child nodes.

If you did though, it would be '../spi/spi-controller.yaml'

Rob

  reply	other threads:[~2019-10-30 13:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25 20:43 DT schemas for multi-transport bindings Dmitry Torokhov
2019-10-30 13:19 ` Rob Herring [this message]
2019-10-30 23:18   ` Dmitry Torokhov
2019-10-31  1:13     ` 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=20191030131936.GA26946@bogus \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    /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).