public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org, Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: [PATCH 0/2] dt-bindings:iio:yaml conversions with xor condition
Date: Thu,  1 Apr 2021 15:09:54 +0100	[thread overview]
Message-ID: <20210401140956.224084-1-jic23@kernel.org> (raw)

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These two binding conversions are left from last year because I couldn't
figure out how to do the XOR between spi-cpha and spi-cpol without
using a $ref.  Rob suggested it should work by lifting the $ref block
and putting it inline but that ran into a restriction the dt-schema that
a oneOf is not allowed directly under an allOf.

Line 34 of schema/base.yaml
  allOf:
    items:
      propertyNames:
        enum:
          - $ref
          - if
          - then
          - else
  anyOf: true

I was just about to send a pull request to relax that constraint when I
realized that a top level oneOf was sufficient for this XoR condition
because it rules out more than one of the options being true at the same
time.  Hence the simplified version given here constrains things correctly.

oneOf:
  - required:
      - spi-cpha
  - required:
      - spi-cpol

We don't need to also specify
not:
  required: [spi-cpha, spi-cpol]
as done in earlier versions of these bindings.

One other minor change in patch 2 to make Should -> Must to avoid
confusion.

Jonathan Cameron (2):
  dt-bindings:iio:dac:ad5755: txt to yaml format conversion.
  dt-bindings:iio:dac:ti,dac082s085 yaml conversion

 .../devicetree/bindings/iio/dac/ad5755.txt    | 124 -------------
 .../bindings/iio/dac/adi,ad5755.yaml          | 171 ++++++++++++++++++
 .../bindings/iio/dac/ti,dac082s085.yaml       |  72 ++++++++
 .../bindings/iio/dac/ti-dac082s085.txt        |  34 ----
 4 files changed, 243 insertions(+), 158 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/dac/ad5755.txt
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/ti,dac082s085.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/dac/ti-dac082s085.txt

-- 
2.31.1


             reply	other threads:[~2021-04-01 17:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 14:09 Jonathan Cameron [this message]
2021-04-01 14:09 ` [PATCH 1/2] dt-bindings:iio:dac:ad5755: txt to yaml format conversion Jonathan Cameron
2021-04-09 14:30   ` Rob Herring
2021-04-01 14:09 ` [PATCH 2/2] dt-bindings:iio:dac:ti,dac082s085 yaml conversion Jonathan Cameron
2021-04-09 14:31   ` Rob Herring
2021-04-24 17:23     ` Jonathan Cameron

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=20210401140956.224084-1-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=devicetree@vger.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