[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <389546877ae11b18928b432e86710acf83974f67.camel@gmail.com>
Date: Fri, 07 Jun 2024 11:20:52 +0200
From: Nuno Sá <noname.nuno@...il.com>
To: dumitru.ceclan@...log.com
Cc: Lars-Peter Clausen <lars@...afoo.de>, Michael Hennerich
<Michael.Hennerich@...log.com>, Jonathan Cameron <jic23@...nel.org>, Rob
Herring <robh@...nel.org>, Krzysztof Kozlowski
<krzysztof.kozlowski+dt@...aro.org>, Conor Dooley <conor+dt@...nel.org>,
David Lechner <dlechner@...libre.com>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, Dumitru Ceclan
<mitrutzceclan@...il.com>
Subject: Re: [PATCH v6 9/9] iio: adc: ad7173: Add support for AD411x devices
On Thu, 2024-06-06 at 19:07 +0300, Dumitru Ceclan via B4 Relay wrote:
> From: Dumitru Ceclan <dumitru.ceclan@...log.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@...log.com>
> ---
> drivers/iio/adc/ad7173.c | 317 ++++++++++++++++++++++++++++++++++++++++++----
> -
> 1 file changed, 285 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
> index 58da5717fd36..cfcd12447e24 100644
> --- a/drivers/iio/adc/ad7173.c
> +++ b/drivers/iio/adc/ad7173.c
>
...
> static const struct ad7173_device_info ad7172_2_device_info = {
> .name = "ad7172-2",
> .id = AD7172_2_ID,
> - .num_inputs = 5,
> + .num_voltage_in = 5,
> .num_channels = 4,
> .num_configs = 4,
> .num_gpios = 2,
> + .higher_gpio_bits = false,
No need to explicitly set to 'false'. Ditto for the other places...
...
>
> static int ad7173_validate_voltage_ain_inputs(struct ad7173_state *st,
> unsigned int ain0, unsigned int
> ain1)
> {
> @@ -946,15 +1145,30 @@ static int ad7173_validate_voltage_ain_inputs(struct
> ad7173_state *st,
> st->info->has_pow_supply_monitoring)
> return 0;
>
> - special_input0 = AD7173_IS_REF_INPUT(ain0);
> - special_input1 = AD7173_IS_REF_INPUT(ain1);
> + special_input0 = AD7173_IS_REF_INPUT(ain0) ||
> + (ain0 == AD4111_VINCOM_INPUT && st->info-
> >has_vincom_input);
> + special_input1 = AD7173_IS_REF_INPUT(ain1) ||
> + (ain1 == AD4111_VINCOM_INPUT && st->info-
> >has_vincom_input);
> +
Wondering... can ain1 (or ain0) be AD4111_VINCOM_INPUT and !st->info-
>has_vincom_input? Would that actually be acceptable? It would assume it's not
so we should check that right? Or am I missing something?
- Nuno Sá
Powered by blists - more mailing lists