public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: "Ceclan, Dumitru" <mitrutzceclan@gmail.com>,
	dumitru.ceclan@analog.com, Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/9] dt-bindings: adc: ad7173: add support for ad411x
Date: Sun, 19 May 2024 17:54:38 +0100	[thread overview]
Message-ID: <20240519175438.5959fab2@jic23-huawei> (raw)
In-Reply-To: <CAMknhBFKM+DC9jNDV+cZ5agwsXJ1iqU9DB3XD-y3sVcRWJOAsQ@mail.gmail.com>


> >  
> > >> +
> > >> +          There are special values that can be selected besides the voltage
> > >> +          analog inputs:
> > >> +            21: REF+
> > >> +            22: REF−
> > >> +          Supported only by AD7172-2, AD7172-4, AD7175-2, AD7175-8, AD7177-2:
> > >> +            19: ((AVDD1 − AVSS)/5)+
> > >> +            20: ((AVDD1 − AVSS)/5)−
> > >> +          Supported only by AD4111, AD4112:
> > >> +            12: IIN3+
> > >> +            11: IIN3−
> > >> +            13: IIN2+
> > >> +            10: IIN2−
> > >> +            14: IIN1+
> > >> +             9: IIN1−
> > >> +            15: IIN0+
> > >> +             8: IIN0−  
> > >
> > > I just made a late reply on v1 where Jonathan suggested that the
> > > current inputs are differential with a similar comment to this:
> > >
> > > It doesn't seem to me like current inputs are differential if they are
> > > only measuring one current. They take 2 pins because you need a way
> > > for current to come in and go back out, but the datasheet calls them
> > > single-ended inputs.
> > >  
> > It seemed to me that the conclusion that we arrived to was to expose the
> > precise pins that are used in the conversion and document the selection.
> >
> > Yes, it is a single-ended channel. So revert to the way it was in V1 using
> > single-channel?  
> 
> I'd like to hear Jonathan's opinion on this one.

Yes.  I think we rather went off on a false tangent on this.  Any current input
using a shunt is of this form and so far we've treated them as single ended :(
e.g. pac1934 does this for it's sense inputs where there is an external
'sense resitor'.  Similar for the stand alone afe driver for a current sense shunt
which is used with a differential voltage input, but presents a single ended
current measurement.

Sorry for misguiding things :( 

At the end of this, I don't suppose anyone fancies writing up some notes
on how to describe different types of channel?

> 
> >  
> > >> +
> > >>          items:
> > >>            minimum: 0
> > >>            maximum: 31
> > >> @@ -154,6 +195,23 @@ patternProperties:
> > >>            - avdd
> > >>          default: refout-avss
> > >>
> > >> +      adi,current-channel:
> > >> +        description: |
> > >> +          Signal that the selected inputs are current channels.
> > >> +          Only available on AD4111 and AD4112.
> > >> +        type: boolean

I'm lost. Why do we need this one?  Is the channel selection not sufficient
to tell us this?

> > >> +
> > >> +      adi,channel-type:
> > >> +        description:
> > >> +          Used to differentiate between different channel types as the device
> > >> +           register configurations are the same for all usage types.
> > >> +        $ref: /schemas/types.yaml#/definitions/string
> > >> +        enum:
> > >> +          - single-ended
> > >> +          - pseudo-differential
> > >> +          - differential
> > >> +        default: differential
> > >> +  
> > >
> > > As suggested above, we should soon have diff-channels and
> > > single-channel to differentiate between (fully) differential and
> > > single-ended. Do we actually need to differentiate between
> > > single-ended and pseudo-differential though?
> > >  
> > Not really, so just a bool differential flag? (this seems weird as we have diff-channels)  
> 
> Or we need to change the proposed single-channel property to allow two
> inputs. I guess we'll see what Johnathan has to say.

I think single ended fits better for the current channels with just one
parameter.




  reply	other threads:[~2024-05-19 16:54 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14  7:22 [PATCH v2 0/9] Add support for AD411x Dumitru Ceclan via B4 Relay
2024-05-14  7:22 ` [PATCH v2 1/9] dt-bindings: adc: ad7173: add support for ad411x Dumitru Ceclan via B4 Relay
2024-05-15 22:37   ` David Lechner
2024-05-16 15:49     ` Ceclan, Dumitru
2024-05-16 16:43       ` David Lechner
2024-05-19 16:54         ` Jonathan Cameron [this message]
2024-05-14  7:22 ` [PATCH v2 2/9] iio: adc: ad7173: fix buffers enablement for ad7176-2 Dumitru Ceclan via B4 Relay
2024-05-14  7:22 ` [PATCH v2 3/9] iio: adc: ad7173: refactor channel configuration parsing Dumitru Ceclan via B4 Relay
2024-05-19 16:58   ` Jonathan Cameron
2024-05-14  7:22 ` [PATCH v2 4/9] iio: adc: ad7173: refactor ain and vref selection Dumitru Ceclan via B4 Relay
2024-05-15 22:54   ` David Lechner
2024-05-19 19:17   ` Jonathan Cameron
2024-05-14  7:22 ` [PATCH v2 5/9] iio: adc: ad7173: add support for special inputs Dumitru Ceclan via B4 Relay
2024-05-15 23:27   ` David Lechner
2024-05-16 16:03     ` Ceclan, Dumitru
2024-05-14  7:22 ` [PATCH v2 6/9] iio: adc: ad7173: Add ad7173_device_info names Dumitru Ceclan via B4 Relay
2024-05-15 23:32   ` David Lechner
2024-05-16 16:09     ` Ceclan, Dumitru
2024-05-16 16:43       ` David Lechner
2024-05-19 17:09         ` Jonathan Cameron
2024-05-14  7:22 ` [PATCH v2 7/9] iio: adc: ad7173: Remove index from temp channel Dumitru Ceclan via B4 Relay
2024-05-15 23:34   ` David Lechner
2024-05-19 17:08     ` Jonathan Cameron
2024-05-14  7:22 ` [PATCH v2 8/9] iio: adc: ad7173: Add support for AD411x devices Dumitru Ceclan via B4 Relay
2024-05-19 17:13   ` Jonathan Cameron
2024-05-14  7:22 ` [PATCH v2 9/9] iio: adc: ad7173: Reduce device info struct size Dumitru Ceclan via B4 Relay
2024-05-15 22:35 ` [PATCH v2 0/9] Add support for AD411x David Lechner
2024-05-16 16:15   ` Ceclan, Dumitru

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=20240519175438.5959fab2@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=dumitru.ceclan@analog.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mitrutzceclan@gmail.com \
    --cc=robh@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