From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Ceclan Dumitru <mitrutzceclan@gmail.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
linus.walleij@linaro.org, brgl@bgdev.pl, andy@kernel.org,
linux-gpio@vger.kernel.org,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Jonathan Cameron" <jic23@kernel.org>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Michael Walle" <michael@walle.cc>,
"Andy Shevchenko" <andy.shevchenko@gmail.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"ChiaEn Wu" <chiaen_wu@richtek.com>,
"Niklas Schnelle" <schnelle@linux.ibm.com>,
"Leonard Göhrs" <l.goehrs@pengutronix.de>,
"Mike Looijmans" <mike.looijmans@topic.nl>,
"Haibo Chen" <haibo.chen@nxp.com>,
"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
"Ceclan Dumitru" <dumitru.ceclan@analog.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v11 1/2] dt-bindings: adc: add AD7173
Date: Thu, 18 Jan 2024 09:21:10 +0000 [thread overview]
Message-ID: <20240118092110.00002c44@Huawei.com> (raw)
In-Reply-To: <cf48e196-a569-4287-93b7-b5f06c34d6f6@gmail.com>
On Thu, 18 Jan 2024 10:10:46 +0200
Ceclan Dumitru <mitrutzceclan@gmail.com> wrote:
> On 1/17/24 18:37, Jonathan Cameron wrote:
> > On Wed, 17 Jan 2024 14:43:21 +0200
> > Ceclan Dumitru <mitrutzceclan@gmail.com> wrote:
> >> On 1/16/24 18:30, Jonathan Cameron wrote:
> >>> On Mon, 15 Jan 2024 15:53:39 -0600
> >>> David Lechner <dlechner@baylibre.com> wrote:
> >>>> On Wed, Dec 20, 2023 at 4:48 AM Dumitru Ceclan <mitrutzceclan@gmail.com> wrote:
>
> ...
>
> >>>>> +
> >>>>> + refin-supply:
> >>>>> + description: external reference supply, can be used as reference for conversion.
> >>>> If I'm understanding correctly, this represents both voltage inputs
> >>>> REF+ and REF-, correct? The datasheet says "Reference Input Negative
> >>>> Terminal. REF− can span from AVSS to AVDD1 − 1 V". It seems like they
> >>>> should be separate supplies in case REF- is non-zero. Otherwise, how
> >>>> can we know what voltage it is? (same comment applies to refin2.)
> >>> Agreed, in this case these are directly used as references (we recently
> >>> had another driver that could take a wide range of negative and positive
> >>> inputs but in that case an internal reference was generated that didn't
> >>> made it not matter exactly what was being supplied. Not true here though!
> >>>
> >> Wouldn't it be alright to specify that the voltage specified here should
> >> be the actual difference (REF+)-(REF-)?
> > How do you establish the offset to apply to single ended channels if you don't
> > know the value of REF- (relative to local ground)?
> >
> > So no - as the device supports single ended channels the difference isn't
> > enough information. It would probably be fine to do as you say if it
> > were a device with only differential channels where all that matters is
> > the scaling.
>
> I suppose that you are referring to the first page presentation: "Cross
> point multiplexer; 8 full differential or 16 single-ended channels". I
> consider this to be a bit misleading as all channels are actually fully
> differential (must select positive and negative source, AVSS is not one
> of them).
>
>
> Even more, the datasheet specifies that when using "single-ended"
> inputs you need to select which of the pins is the common one and
> connect it to the desired GND (be it AVSS, REF-):
>
> "Because there is a cross point mux, the user can set any of the analog
> inputs as the common pin. An example of such a scenario is to connect
> the AIN16 pin to AVSS or to the REFOUT voltage (that is, AVSS +
> 2.5 V)" (ad7173-8 page 27)
>
> For me this is 100% the case that this is a fully differential ADC in
> which the datasheet presents a way to use it single-ended. Let's say
> that we are using EXT_REF, and REF- is non zero. If someone connects
> AVSS to the desired common pin, the ADC will still measure correctly the
> difference of voltage between AIN_POS and AIN_NEG and compare it to the
> EXT_REF.
Thanks for the explanation. I indeed was mislead by the introduction!
Seems that the difference in the reference inputs is sufficient for this
device.
Jonathan
next prev parent reply other threads:[~2024-01-18 9:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 10:48 [PATCH v11 1/2] dt-bindings: adc: add AD7173 Dumitru Ceclan
2023-12-20 10:48 ` [PATCH v11 2/2] iio: adc: ad7173: add AD7173 driver Dumitru Ceclan
2024-01-13 14:59 ` Jonathan Cameron
2023-12-21 17:45 ` [PATCH v11 1/2] dt-bindings: adc: add AD7173 Krzysztof Kozlowski
2024-01-08 9:11 ` Ceclan Dumitru
2024-01-09 2:58 ` Rob Herring
2024-01-15 21:53 ` David Lechner
2024-01-16 16:30 ` Jonathan Cameron
2024-01-17 12:43 ` Ceclan Dumitru
2024-01-17 16:37 ` Jonathan Cameron
2024-01-18 8:10 ` Ceclan Dumitru
2024-01-18 9:21 ` Jonathan Cameron [this message]
2024-01-17 12:30 ` Ceclan Dumitru
2024-01-17 16:46 ` 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=20240118092110.00002c44@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=arnd@arndb.de \
--cc=brgl@bgdev.pl \
--cc=chiaen_wu@richtek.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=dumitru.ceclan@analog.com \
--cc=haibo.chen@nxp.com \
--cc=hvilleneuve@dimonoff.com \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=l.goehrs@pengutronix.de \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@walle.cc \
--cc=mike.looijmans@topic.nl \
--cc=mitrutzceclan@gmail.com \
--cc=robh+dt@kernel.org \
--cc=schnelle@linux.ibm.com \
/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).