From: "Ceclan, Dumitru" <mitrutzceclan@gmail.com>
To: David Lechner <dlechner@baylibre.com>, dumitru.ceclan@analog.com
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
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 6/6] iio: adc: ad7173: Add support for AD411x devices
Date: Wed, 3 Apr 2024 11:15:04 +0300 [thread overview]
Message-ID: <77064a96-c195-4f34-a323-ac01137e448d@gmail.com> (raw)
In-Reply-To: <CAMknhBH-YmFrqNTQCB_KafCTxEqSL+36pkE0O44NqiL89hm64Q@mail.gmail.com>
On 02/04/2024 00:53, David Lechner wrote:
> On Mon, Apr 1, 2024 at 10:10 AM Dumitru Ceclan via B4 Relay
> <devnull+dumitru.ceclan.analog.com@kernel.org> wrote:
>>
>> From: Dumitru Ceclan <dumitru.ceclan@analog.com>
>>
>> Add support for AD4111/AD4112/AD4114/AD4115/AD4116.
>>
>> The AD411X family encompasses a series of low power, low noise, 24-bit,
>> sigma-delta analog-to-digital converters that offer a versatile range of
>> specifications.
>>
>> This family of ADCs integrates an analog front end suitable for processing
>> both fully differential and single-ended, bipolar voltage inputs
>> addressing a wide array of industrial and instrumentation requirements.
>>
>> - All ADCs have inputs with a precision voltage divider with a division
>> ratio of 10.
>> - AD4116 has 5 low level inputs without a voltage divider.
>> - AD4111 and AD4112 support current inputs (0 mA to 20 mA) using a 50ohm
>> shunt resistor.
>>
>> Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
>> ---
>
> ...
>
>> @@ -951,7 +1117,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev)
>> struct device *dev = indio_dev->dev.parent;
>> struct iio_chan_spec *chan_arr, *chan;
>> unsigned int ain[2], chan_index = 0;
>> - int ref_sel, ret, num_channels;
>> + int ref_sel, ret, reg, num_channels;
>>
>> num_channels = device_get_child_node_count(dev);
>>
>
> Another thing that is missing in this function both for the chips
> being added here and the existing chips are channels for _all_
> possible inputs. The driver is adding a fixed input channel for the
> temperature sensor, as it should. But all of the chips also have a
> similar input channel configuration that measures the reference
> voltage. Currently, there doesn't seem to be a way to make use of this
> feature. I would expect a hard-coded voltage input channel that is
> always added for this reference voltage similar to the temperature
> channel.
>
AD7173-8:
Channel input configs:
AINPOS0: REF+ 10101: 21
AINNEG0: REF- 10110: 22
For the user to define the REF measurement channel:
diff-channels = <21 22>;
So it is possible from the binding side. It would just need support from
the driver as currently any value above the stated number of inputs is
rejected. Maybe document this in a comment like you suggested below.
I really do not agree with using up channels without letting the user
decide. I can accept to dedicate one for the temp where applicable but
more than that and it feels like we are restricting the usage too much.
> The ad717x chips (except AD7173-8 and AD7176-2) also have a common
> mode voltage input ("((AVDD1 − AVSS)/5)") that could work the same.
>
Again, would be resolved if I added support from the driver.
> In the case of the ad717x chips though, it looks like these channels
> are not "fixed" like they are in ad411x. It looks like these inputs
> can be mixed and matched with AINx inputs and/or each other as
> differential pairs. So if that is actually the case, I would expect
> the DT bindings for ad717x to look like adi,ad4130.yaml where these
> additional input sources are listed in the diff-channels property
> instead of having hard-coded channels in the driver like I have
> suggested above.
>
Yep, agree.
> But, as always, fixes for ad717x should be in a separate patch series.
> Still, I think adding a hard-coded channel for the reference voltage
> input for ad411x chips in this patch makes sense.
As stated above, not comfortable with using up channels with hard-coded
values.
prev parent reply other threads:[~2024-04-03 8:15 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-01 15:32 [PATCH 0/6] Add support for AD411x Dumitru Ceclan via B4 Relay
2024-04-01 15:32 ` [PATCH 1/6] dt-bindings: adc: ad7173: add support for ad411x Dumitru Ceclan via B4 Relay
2024-04-01 19:37 ` David Lechner
2024-04-01 20:22 ` David Lechner
2024-04-03 7:45 ` Ceclan, Dumitru
2024-04-03 10:08 ` Ceclan, Dumitru
2024-04-03 15:14 ` David Lechner
2024-04-01 21:16 ` David Lechner
2024-04-03 7:50 ` Ceclan, Dumitru
2024-04-03 15:22 ` David Lechner
2024-04-04 13:08 ` Ceclan, Dumitru
2024-04-06 14:26 ` Jonathan Cameron
2024-04-09 8:10 ` Ceclan, Dumitru
2024-04-03 7:43 ` Ceclan, Dumitru
2024-04-03 15:40 ` David Lechner
2024-04-06 14:53 ` Jonathan Cameron
2024-04-09 8:08 ` Ceclan, Dumitru
2024-04-13 10:49 ` Jonathan Cameron
2024-04-15 18:42 ` Ceclan, Dumitru
2024-04-20 14:33 ` Jonathan Cameron
2024-04-23 8:18 ` Ceclan, Dumitru
2024-04-28 17:13 ` Jonathan Cameron
2024-05-09 13:48 ` Ceclan, Dumitru
2024-05-15 21:42 ` David Lechner
2024-05-16 8:18 ` Ceclan, Dumitru
2024-04-01 15:32 ` [PATCH 2/6] iio: adc: ad7173: fix buffers enablement for ad7176-2 Dumitru Ceclan via B4 Relay
2024-04-01 19:38 ` David Lechner
2024-04-06 14:56 ` Jonathan Cameron
2024-04-08 16:40 ` Ceclan, Dumitru
2024-04-13 10:50 ` Jonathan Cameron
2024-04-01 15:32 ` [PATCH 3/6] iio: adc: ad7173: refactor channel configuration parsing Dumitru Ceclan via B4 Relay
2024-04-01 19:39 ` David Lechner
2024-04-03 10:01 ` Ceclan, Dumitru
2024-04-03 15:55 ` David Lechner
2024-04-01 15:32 ` [PATCH 4/6] iio: adc: ad7173: refactor ain and vref selection Dumitru Ceclan via B4 Relay
2024-04-01 19:40 ` David Lechner
2024-04-03 10:03 ` Ceclan, Dumitru
2024-04-03 16:02 ` David Lechner
2024-04-06 15:03 ` Jonathan Cameron
2024-04-01 15:32 ` [PATCH 5/6] iio: adc: ad7173: Remove index from temp channel Dumitru Ceclan via B4 Relay
2024-04-01 19:40 ` David Lechner
2024-04-01 15:32 ` [PATCH 6/6] iio: adc: ad7173: Add support for AD411x devices Dumitru Ceclan via B4 Relay
2024-04-01 19:45 ` David Lechner
2024-04-02 14:00 ` David Lechner
2024-04-03 9:55 ` Ceclan, Dumitru
2024-04-03 9:53 ` Ceclan, Dumitru
2024-04-03 16:37 ` David Lechner
2024-04-06 15:10 ` Jonathan Cameron
2024-05-14 7:28 ` Ceclan, Dumitru
2024-04-01 21:53 ` David Lechner
2024-04-03 8:15 ` Ceclan, Dumitru [this message]
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=77064a96-c195-4f34-a323-ac01137e448d@gmail.com \
--to=mitrutzceclan@gmail.com \
--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=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).