devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Cosmin Tanislav <demonsingur@gmail.com>
Cc: "Nuno Sá" <nuno.sa@analog.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Cosmin Tanislav" <cosmin.tanislav@analog.com>
Subject: Re: [PATCH 2/3] dt-bindings: iio: temperature: ltc2983: support more parts
Date: Tue, 18 Oct 2022 08:01:58 +0200	[thread overview]
Message-ID: <746850ef315a8d17f34a72e83b74f9c726d56d48.camel@gmail.com> (raw)
In-Reply-To: <7cea27d8-c3c6-4bc2-0072-1168c9c6a2f0@linaro.org>

On Mon, 2022-10-17 at 19:32 -0400, Krzysztof Kozlowski wrote:
> On 17/10/2022 05:38, Nuno Sá wrote:
> > Hi Krzysztof,
> > 
> 
> (...)
> 
> > > > @@ -353,6 +361,41 @@ patternProperties:
> > > >          description: Boolean property which set's the adc as
> > > > single-ended.
> > > >          type: boolean
> > > >  
> > > > +  "^temp@":
> > > 
> > > There is already a property for thermocouple. Isn't a
> > > thermocouple a
> > > temperature sensor? IOW, why new property is needed?
> > > 
> > 
> > Well, most of the patternProps in this bindings are temperature
> > sensors... It's just that the device(s) support different types of
> > them. 'adi,sensor-type' is used to identify each sensor (as this
> > translates in different configurations being written in the device
> > channels).
> 
> Sure.
> 
> > 
> > > > +    type: object
> > > > +    description:
> > > > +      Represents a channel which is being used as an active
> > > > analog
> > > > temperature
> > > > +      sensor.
> > > > +
> > > > +    properties:
> > > > +      adi,sensor-type:
> > > > +        description:
> > > > +          Identifies the sensor as an active analog
> > > > temperature
> > > > sensor.
> > > > +        $ref: /schemas/types.yaml#/definitions/uint32
> > > > +        const: 31
> > > > +
> > > > +      adi,single-ended:
> > > > +        description: Boolean property which sets the sensor as
> > > > single-ended.
> > > 
> > > Drop "Boolean property which sets" - it's obvious from the type.
> > > 
> > > 
> > > 
> > > > +        type: boolean
> > > > +
> > > > +      adi,custom-temp:
> > > > +        description:
> > > > +          This is a table, where each entry should be a pair
> > > > of
> > > 
> > > "This is a table" - obvious from the type.
> > > 
> > > > +          voltage(mv)-temperature(K). The entries must be
> > > > given in
> > > > nv and uK
> > > 
> > > mv-K or nv-uK? Confusing...
> > 
> > Yeah, a bit. In Cosmin defense, I think he's just keeping the same
> > "style" as the rest of the properties...
> 
> That's not the best approach for two reasons:
> 1. The unit used by hardware matters less here, because bindings are
> used to write DTS. In many, many other cases there will be some
> translation (just take random voltage regulator bindings).
> 
> 2. What the driver is doing matters even less.
> 
> So just describe here what is expected in DTS.
> 

Alright, I see. So we just refer to nv-uK as that is what I wanted for
dts to expect (reason being to have more resolution).

> > 
> > > 
> > > > +          so that, the original values must be multiplied by
> > > > 1000000. For
> > > > +          more details look at table 71 and 72.
> > > 
> > > There is no table 71 in the bindings... It seems you pasted it
> > > from
> > > somewhere.
> > 
> > I'm fairly sure this refers to the datasheet. I see now that this
> > can
> > be confusing (again this kind of references are being (ab)used in
> > the
> > rest of the file).
> 
> Yep, but there are now multiple datasheets, aren't there?
> 

Hmm yeah that's true. By the time I wrote this binding I was not even
thinking on the possibility of new parts being added to it... I guess
the lesson in here is to avoid this kind os specific descriptions.

> > 
> > > 
> > > > +          Note should be signed, but dtc doesn't currently
> > > > maintain the
> > > > +          sign.
> > > 
> > > What do you mean? "Maintain" as allow or keep when building FDT? 
> > > What's
> > > the problem of using negative numbers here and why it should be
> > > part
> > > of
> > > bindings?
> > > 
> > > > +        $ref: /schemas/types.yaml#/definitions/uint64-matrix
> > > > +        minItems: 3
> > > > +        maxItems: 64
> > > > +        items:
> > > > +          minItems: 2
> > > > +          maxItems: 2
> > > 
> > > Instead describe the items with "description" (and maybe
> > > constraints)
> > > like here:
> > > 
> > > https://elixir.bootlin.com/linux/v5.19/source/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml#L278
> > > 
> > 
> > Neat... My only comment (which probably applies to my previous
> > ones) is
> > that the rest of the properties are already in this "style". So
> > maybe,
> > follow up patches with small clean-ups would be more appropriate?
> 
> Of course. It would be great if the file was improved before or after
> this one.
> 

Ok, IMO it would make sense to have it in this series but if Cosmin
does not feel like fixing my mess :), I'll send a separate patch with
your inputs...

- Nuno Sá

  reply	other threads:[~2022-10-18  6:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-14 12:37 [PATCH 0/3] Support more parts in LTC2983 Cosmin Tanislav
2022-10-14 12:37 ` [PATCH 1/3] iio: temperature: ltc2983: allocate iio channels once Cosmin Tanislav
2022-10-14 14:11   ` Jonathan Cameron
2022-10-14 15:18     ` Jonathan Cameron
2022-10-15 16:35       ` Jonathan Cameron
2022-10-14 12:37 ` [PATCH 2/3] dt-bindings: iio: temperature: ltc2983: support more parts Cosmin Tanislav
2022-10-14 15:37   ` Jonathan Cameron
2022-10-17  7:01     ` Cosmin Tanislav
2022-10-17 10:22       ` Jonathan Cameron
2022-10-17  1:59   ` Krzysztof Kozlowski
2022-10-17  6:53     ` Cosmin Tanislav
2022-10-17 10:26       ` Jonathan Cameron
2022-10-17 10:37         ` Jonathan Cameron
2022-10-17 23:26       ` Krzysztof Kozlowski
2022-10-17  9:38     ` Nuno Sá
2022-10-17 10:04       ` Nuno Sá
2022-10-17 23:32       ` Krzysztof Kozlowski
2022-10-18  6:01         ` Nuno Sá [this message]
2022-10-14 12:37 ` [PATCH 3/3] " Cosmin Tanislav
2022-10-14 15:44   ` Jonathan Cameron
2022-10-17  6:59     ` Cosmin Tanislav
2022-10-17 10:29       ` 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=746850ef315a8d17f34a72e83b74f9c726d56d48.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=cosmin.tanislav@analog.com \
    --cc=demonsingur@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --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).