From: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Cosmin Tanislav <demonsingur@gmail.com>
Cc: Cosmin Tanislav <cosmin.tanislav@analog.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] dt-bindings: iio: addac: add AD74115
Date: Mon, 3 Oct 2022 13:09:19 -0500 [thread overview]
Message-ID: <20221003180919.GA2515957-robh@kernel.org> (raw)
In-Reply-To: <7ef3a31a-fa6a-1a54-6e60-ff0c5df28301@linaro.org>
On Mon, Oct 03, 2022 at 12:45:31PM +0200, Krzysztof Kozlowski wrote:
> On 03/10/2022 12:30, Cosmin Tanislav 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>
>
> I got only this patch. Where is the cover letter?
>
>
> > ---
> > .../bindings/iio/addac/adi,ad74115.yaml | 491 ++++++++++++++++++
> > MAINTAINERS | 7 +
> > 2 files changed, 498 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..1f894d80b259
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml
>
> Filename matching compatible, so adi,ad74115h.yaml
>
> > @@ -0,0 +1,491 @@
> > +# 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
> > +
>
> Missing allOf-ref to spi properties.
>
> > +properties:
> > + compatible:
> > + enum:
> > + - adi,ad74115h
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + '#address-cells':
> > + const: 1
> > +
> > + '#size-cells':
> > + const: 0
> > +
> > + spi-max-frequency:
> > + maximum: 24000000
> > +
> > + spi-cpol: true
> > +
> > + interrupts:
> > + maxItems: 1
> > +
> > + avdd-supply: true
> > + avcc-supply: true
> > + dvcc-supply: true
> > + aldo1v8-supply: true
> > + dovdd-supply: true
> > + refin-supply: true
> > +
> > + adi,ch-func:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: |
> > + Channel function.
> > + 0 - High impedance
> > + 1 - Voltage output
> > + 2 - Current output
> > + 3 - Voltage input
> > + 4 - Current input, externally-powered
> > + 5 - Current input, loop-powered
> > + 6 - Resistance input
> > + 7 - RTD measure
> > + 8 - Digital input logic
> > + 9 - Digital input, loop-powered
> > + 10 - Current output with HART
> > + 11 - Current input, externally-powered, with HART
> > + 12 - Current input, loop-powered, with HART
> > + minimum: 0
> > + maximum: 12
> > + default: 0
> > +
> > + adi,conv2-mux:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: |
> > + Input node for ADC conversion 2.
>
> node or mode?
>
> > + 0 - SENSE_EXT1 to AGND_SENSE
> > + 1 - SENSE_EXT2 to AGND_SENSE
> > + 2 - SENSE_EXT2 to SENSE_EXT1
> > + 3 - AGND to AGND
> > + minimum: 0
> > + maximum: 3
> > + default: 0
> > +
> > + adi,conv2-range:
> > + $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
> > + minimum: 0
> > + maximum: 7
> > + default: 0
> > +
> > + adi,diag0-func:
> > + $ref: /schemas/types.yaml#/definitions/uint32
>
> This nicely matches a string enum.
Then the driver has to do a bunch of string comparisons to get back to a
register setting. Worth it if something common, but for a device
specific setting, I'd just stick with register field values.
If these are diagnostic/debug, why would you want it in DT to begin
with? Wouldn't someone want to change this at run-time? Seems like a
debugfs feature instead.
>
> > + description: |
> > + Diagnostic channel 0 function.
> > + 0 - Disabled
> > + 1 - Temperature sensor
> > + 2 - DVCC
> > + 3 - AVCC
> > + 4 - ALDO1V8
> > + 5 - DLDO1V8
> > + 6 - REFOUT
> > + 7 - AVDD
> > + 8 - AVSS
> > + 9 - LVIN
> > + 10 - SENSEL
> > + 11 - SENSE_EXT1
> > + 12 - SENSE_EXT2
> > + 13 - DO_VDD
> > + 14 - AGND
> > + 15 - Sinking current from external digital output
> > + minimum: 0
> > + maximum: 15
> > + default: 0
> > +
> > + adi,diag1-func:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: |
>
> Ditto
next prev parent reply other threads:[~2022-10-03 18:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20221003103016.195805-1-demonsingur@gmail.com>
2022-10-03 10:30 ` [PATCH 1/2] dt-bindings: iio: addac: add AD74115 Cosmin Tanislav
2022-10-03 10:45 ` Krzysztof Kozlowski
2022-10-03 18:09 ` Rob Herring [this message]
2022-10-03 10:30 ` [PATCH 2/2] iio: addac: add AD74115 driver Cosmin Tanislav
2022-10-09 18:01 ` Jonathan Cameron
2022-10-29 16:13 ` 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=20221003180919.GA2515957-robh@kernel.org \
--to=robh@kernel.org \
--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 \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.