[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cf48e196-a569-4287-93b7-b5f06c34d6f6@gmail.com>
Date: Thu, 18 Jan 2024 10:10:46 +0200
From: Ceclan Dumitru <mitrutzceclan@...il.com>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc: David Lechner <dlechner@...libre.com>, linus.walleij@...aro.org,
brgl@...ev.pl, andy@...nel.org, linux-gpio@...r.kernel.org,
Lars-Peter Clausen <lars@...afoo.de>, Jonathan Cameron <jic23@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>, Michael Walle <michael@...le.cc>,
Andy Shevchenko <andy.shevchenko@...il.com>, Arnd Bergmann <arnd@...db.de>,
ChiaEn Wu <chiaen_wu@...htek.com>, Niklas Schnelle <schnelle@...ux.ibm.com>,
Leonard Göhrs <l.goehrs@...gutronix.de>,
Mike Looijmans <mike.looijmans@...ic.nl>, Haibo Chen <haibo.chen@....com>,
Hugo Villeneuve <hvilleneuve@...onoff.com>,
Ceclan Dumitru <dumitru.ceclan@...log.com>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v11 1/2] dt-bindings: adc: add AD7173
On 1/17/24 18:37, Jonathan Cameron wrote:
> On Wed, 17 Jan 2024 14:43:21 +0200
> Ceclan Dumitru <mitrutzceclan@...il.com> wrote:
>> On 1/16/24 18:30, Jonathan Cameron wrote:
>>> On Mon, 15 Jan 2024 15:53:39 -0600
>>> David Lechner <dlechner@...libre.com> wrote:
>>>> On Wed, Dec 20, 2023 at 4:48 AM Dumitru Ceclan <mitrutzceclan@...il.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.
Powered by blists - more mailing lists