Re: [PATCH 6/6] iio: adc: ad7173: Add support for AD411x devices

From: Ceclan, Dumitru
Date: Wed Apr 03 2024 - 05:55:40 EST


On 02/04/2024 17:00, David Lechner wrote:
> On Mon, Apr 1, 2024 at 2:45 PM David Lechner <dlechner@xxxxxxxxxxxx> wrote:
>>
>> On Mon, Apr 1, 2024 at 10:10 AM Dumitru Ceclan via B4 Relay
>> <devnull+dumitru.ceclan.analog.com@xxxxxxxxxx> wrote:

..

>>> *chan = ad7173_channel_template;
>>> chan->address = chan_index;
>>> chan->scan_index = chan_index;
>>> - chan->channel = ain[0];
>>> - chan->channel2 = ain[1];
>>> - chan->differential = true;
>>>
>>> - chan_st_priv->ain = AD7173_CH_ADDRESS(ain[0], ain[1]);
>>> + if (reg >= AD4111_CURRENT_CHAN_CUTOFF) {
>>> + chan->type = IIO_CURRENT;
>>> + chan->channel = ain[0];
>>> + chan_st_priv->ain = ad4111_current_channel_config[ain[0]];
>>> + } else {
>>> + chan->channel = ain[0];
>>> + chan->channel2 = ain[1];
>>> + chan->differential = true;
>>
>> Expecting chan->differential = false when ADCIN15 is configured for
>> pseudo-differential inputs.
>>
>> Also, perhaps missed in previous reviews, I would expect
>> chan->differential = false when channels are used as single-ended.
>>
>
> After sleeping on it, I came to the concision that these parts are
> probably too complex to try to worry about differential vs.
> pseudo-differential/single-ended (what the datasheet calls
> single-ended is really pseudo-differential).
>
> So I take back my comments about expecting differential = false in those cases.

Alrighty then