devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cosmin Tanislav <demonsingur@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Cosmin Tanislav <cosmin.tanislav@analog.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	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, 08 Nov 2022 10:51:18 +0200	[thread overview]
Message-ID: <c01b0e56563b2b6f8ef48ad90977646706a2c933.camel@gmail.com> (raw)
In-Reply-To: <20221106154634.2286faf3@jic23-huawei>

On Sun, 2022-11-06 at 15:46 +0000, Jonathan Cameron wrote:
> On Thu,  3 Nov 2022 11:44:35 +0200
> Cosmin Tanislav <demonsingur@gmail.com> wrote:
> 
> > From: Cosmin Tanislav <cosmin.tanislav@analog.com>
> > 
> > The AD74115H is a single-channel, software-configurable, input and
> > output device for industrial control applications. The AD74115H
> > provides a wide range of use cases, integrated on a single chip.
> > 
> > These use cases include analog output, analog input, digital output,
> > digital input, resistance temperature detector (RTD), and thermocouple
> > measurement capability. The AD74115H also has an integrated HART modem.
> > 
> > A serial peripheral interface (SPI) is used to handle all communications
> > to the device, including communications with the HART modem. The digital
> > input and digital outputs can be accessed via the SPI or the
> > general-purpose input and output (GPIO) pins to support higher
> > speed data rates.
> > 
> > The device features a 16-bit, sigma-delta analog-to-digital converter
> > (ADC) and a 14-bit digital-to-analog converter (DAC).
> > The AD74115H contains a high accuracy 2.5 V on-chip reference that can
> > be used as the DAC and ADC reference.
> > 
> > Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
> 
> Hi Cosmin,
> 
> A few questions inline.  Complex device so I'll doubt we'll ever get this
> binding to be as tidy as for simpler devices.  Hence most of the below are
> suggestions rather than requirements from me.
> 
> Jonathan
> 
> > ---
> >  .../bindings/iio/addac/adi,ad74115.yaml       | 370 ++++++++++++++++++
> >  MAINTAINERS                                   |   7 +
> >  2 files changed, 377 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml b/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml
> > new file mode 100644
> > index 000000000000..621f11d5c1f3
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml
> > @@ -0,0 +1,370 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/addac/adi,ad74115.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Analog Devices AD74115H device
> > +
> > +maintainers:
> > +  - Cosmin Tanislav <cosmin.tanislav@analog.com>
> > +
> > +description: |
> > +  The AD74115H is a single-channel software configurable input/output
> > +  device for industrial control applications. It contains functionality for
> > +  analog output, analog input, digital output, digital input, resistance
> > +  temperature detector, and thermocouple measurements integrated into a single
> > +  chip solution with an SPI interface. The device features a 16-bit ADC and a
> > +  14-bit DAC.
> > +
> > +    https://www.analog.com/en/products/ad74115h.html
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - adi,ad74115h
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  '#address-cells':
> > +    const: 1
> > +
> > +  '#size-cells':
> > +    const: 0
> 
> I'm not seeing any child nodes, so why do we need these two?
> 

Will fix.

> > +
> > +  avdd-supply: true
> > +  avcc-supply: true
> > +  dvcc-supply: true
> > +  aldo1v8-supply: true
> 
> aldo1v8 is an output pin. "1.8 V Analog LDO Output. Do not use ALDO1V8 externally."
> The associated input is avcc.  Given we shouldn't connect anything to the pin,
> we don't want it in the binding docs
> 

Will fix.

> > +  dovdd-supply: true
> > +  refin-supply: true
> > +
> 
> ...
> 
> > +    $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.

> 
> > +    minimum: 0
> > +    maximum: 7
> > +    default: 0
> > +
> > +  adi,sense-agnd-buffer-lp:
> lp is a little ambiguous, given we have a habit of using it for low pass
> in filters etc. Perhaps worth spelling these out?
>      adi,sens-agnd-buffer-low-power etc?

Will fix.

> 
> > +    type: boolean
> > +    description: |
> > +      Whether to enable low-power buffered mode for the AGND sense pin.
> > +
> > +  adi,lf-buffer-lp:
> > +    type: boolean
> > +    description: |
> > +      Whether to enable low-power buffered mode for the low-side filtered
> > +      sense pin.
> > +
> > +  adi,hf-buffer-lp:
> > +    type: boolean
> > +    description: |
> > +      Whether to enable low-power buffered mode for the high-side filtered
> > +      sense pin.
> > +
> > +  adi,ext2-buffer-lp:
> > +    type: boolean
> > +    description: Whether to enable low-power buffered mode for the EXT2 pin.
> > +
> > +  adi,ext1-buffer-lp:
> > +    type: boolean
> > +    description: Whether to enable low-power buffered mode for the EXT1 pin.
> 
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - spi-cpol
> > +  - avdd-supply
> > +
> > +allOf:
> > +  - $ref: /schemas/spi/spi-peripheral-props.yaml#
> > +  - if:
> > +      properties:
> > +        adi,digital-input-sink-range-high: true
> > +    then:
> > +      properties:
> > +        adi,digital-input-sink-microamp:
> > +          maximum: 7400
> > +
> > +additionalProperties: false
> 
> Does this need to be unevalutatedProperties to allow
> for the extra ones in spi-periphera-props.yaml?
> 

Will fix.

> > +


  reply	other threads:[~2022-11-08  8:51 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 [this message]
2022-11-12 15:40       ` Jonathan Cameron
2022-11-15 12:43         ` Cosmin Tanislav
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=c01b0e56563b2b6f8ef48ad90977646706a2c933.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).