[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231222-thread-secret-d8b49c896249@spud>
Date: Fri, 22 Dec 2023 15:27:36 +0000
From: Conor Dooley <conor@...nel.org>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Petre Rodan <petre.rodan@...dimension.ro>, linux-kernel@...r.kernel.org,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
Conor Dooley <conor+dt@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Rob Herring <robh+dt@...nel.org>,
linux-kernel-mentees@...ts.linuxfoundation.org
Subject: Re: [PATCH 1/2] dt-bindings: iio: pressure: honeywell,mprls0025pa
On Thu, Dec 21, 2023 at 11:04:17AM +0000, Jonathan Cameron wrote:
> On Wed, 20 Dec 2023 19:25:25 +0200
> Petre Rodan <petre.rodan@...dimension.ro> wrote:
>
> > hi Jonathan,
> >
> > On Wed, Dec 20, 2023 at 03:16:45PM +0000, Jonathan Cameron wrote:
> > > On Tue, 19 Dec 2023 15:02:20 +0200
> > > Petre Rodan <petre.rodan@...dimension.ro> wrote:
> > > > honeywell,pmin-pascal:
> > > > description:
> > > > Minimum pressure value the sensor can measure in pascal.
> > > > + To be specified only if honeywell,pressure-triplet is set to "NA".
> > > That just added a backwards compatibility break. It would be fine
> > > if there was a default: NA for honeywell,pressure-triplet or a check that either
> > > one or the other was supplied (which I'd prefer). Thus old bindings will work
> > > and new ones also supported.
> >
> > ok, I see your reasoning. but in this second scenario that you prefer how can we
> > propery define the 'required:' block? an equivalent to
> >
> > required:
> > - compatible
> > - reg
> > - (honeywell,pmin-pascal && honeywell,pmax-pascal) || honeywell,pressure-triplet
> > - honeywell,transfer-function
>
> Yes, it would end up something like that. There are exclusive or examples in tree.
> I think something like dac/adi,ad3552r.yaml
> should work.
>
> oneOf:
> - required:
> - honeywell,pmin-pascal
> - honeywell,pmax-pascal
> - required:
> - honeywell,pressure-triplet
>
> but you will want to try all the cases to make sure that works (my ability to
> figure these ones out is tricky).
>
> + you ideally want to exclude them all being set which is fiddlier.
>
> Some similar examples but they are based on a value in the property. I'm not
> sure how you check for it just being defined.
>
> Something along lines of.
>
> allOf:
> - if:
> properties:
> honeywell,pressure-triplet
> then:
> properties:
> honeywell,pmin-pascal: false
> honeywell,pmax-pascal: false
>
> Might work? I always end up trawling the kernel to find a similar example for cases but
> can't find anything closer right now.
I hate to admit it, but I'm not great at expressing these in the minimum
forms either, but I think you're missing a "required" from here, in place
of the "properties":
allOf:
- if:
required:
- honeywell,pressure-triplet
then:
properties:
honeywell,pmin-pascal: false
honeywell,pmax-pascal: false
Cheers,
Conor.
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists