devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cosmin Tanislav <demonsingur@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: Cosmin Tanislav <cosmin.tanislav@analog.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	William Breathitt Gray <william.gray@linaro.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] dt-bindings: iio: addac: add AD74115
Date: Tue, 15 Nov 2022 14:43:53 +0200	[thread overview]
Message-ID: <c54200fb70d638c572a0596a78d956d9f61d89a4.camel@gmail.com> (raw)
In-Reply-To: <20221112154040.54dc5cf2@jic23-huawei>

On Sat, 2022-11-12 at 15:40 +0000, Jonathan Cameron wrote:
> > >   
> > > > +    $ref: /schemas/types.yaml#/definitions/uint32
> > > > +    description: |
> > > > +      Conversion range for ADC conversion 2.
> > > > +      0 - 0V to 12V
> > > > +      1 - -12V to +12V
> > > > +      2 - -2.5V to +2.5V
> > > > +      3 - -2.5V to 0V
> > > > +      4 - 0V to 2.5V
> > > > +      5 - 0V to 0.625V
> > > > +      6 - -104mV to +104mV
> > > > +      7 - 0V to 12V  
> > > 
> > > For a lot of similar cases we handle these numerically to give
> > > a human readable dts.  Is there a strong reason not to do so here (in mv)
> > >   
> > 
> > I used this approach mostly because it maps dirrectly to register values
> > and because it's easier to parse. dts isn't exactly nice at handling
> > negative values. I can switch it to mv array if you insist.
> 
> We have quite a few existing cases of
> adi,[output-]range-microvolt so it would be good to copy that style here.
> 

With this:

  adi,conv2-range-microvolt:
    description: Conversion range for ADC conversion 2.
    oneOf:
      - items:
          - enum: [-2500000, 0]
          - const: 2500000
      - items:
          - enum: [-12000000, 0]
          - const: 12000000
      - items:
          - const: -2500000
          - const: 0
      - items:
          - const: -104000
          - const: 104000
      - items:
          - const: 0
          - const: 625000

And this:

adi,conv2-range-microvolt = <(-12000000) 12000000>;

I get this:

Documentation/devicetree/bindings/iio/addac/adi,ad74115.example.dtb:
addac@0: adi,conv2-range-microvolt: 'oneOf' conditional failed,
one must be fixed:
        4282967296 is not one of [-2500000, 0]
        4282967296 is not one of [-12000000, 0]
        -2500000 was expected
        -104000 was expected
        625000 was expected
        From schema: Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml

As I said, negative numbers don't play too nice...

> > 
> > >   
> > > > +    minimum: 0
> > > > +    maximum: 7
> > > > +    default: 0
> > > > +


  reply	other threads:[~2022-11-15 12:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03  9:44 [PATCH v2 0/2] AD74115 Cosmin Tanislav
2022-11-03  9:44 ` [PATCH v2 1/2] dt-bindings: iio: addac: add AD74115 Cosmin Tanislav
2022-11-06 15:46   ` Jonathan Cameron
2022-11-08  8:51     ` Cosmin Tanislav
2022-11-12 15:40       ` Jonathan Cameron
2022-11-15 12:43         ` Cosmin Tanislav [this message]
2022-11-15 16:07           ` Jonathan Cameron
2022-11-15 18:16             ` Rob Herring
2022-11-16 10:17               ` Jonathan Cameron
2022-11-07 16:45   ` Rob Herring
2022-11-03  9:44 ` [PATCH v2 2/2] iio: addac: add AD74115 driver Cosmin Tanislav
2022-11-06 16:27   ` Jonathan Cameron
2022-11-07 15:39   ` kernel test robot

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=c54200fb70d638c572a0596a78d956d9f61d89a4.camel@gmail.com \
    --to=demonsingur@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=cosmin.tanislav@analog.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=william.gray@linaro.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).