Re: [PATCH v7 2/4] iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs

From: Jonathan Cameron

Date: Fri Jul 17 2026 - 21:52:08 EST


On Thu, 16 Jul 2026 18:09:36 -0300
Marcelo Schmitt <marcelo.schmitt@xxxxxxxxxx> wrote:

> Support for LTC2378-20 and similar analog-to-digital converters.
>
> Reviewed-by: David Lechner <dlechner@xxxxxxxxxxxx>
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@xxxxxxxxxx>
One entirely trivial comment.

Jonathan

> diff --git a/drivers/iio/adc/ltc2378.c b/drivers/iio/adc/ltc2378.c
> new file mode 100644
> index 000000000000..5600c820c7f4
> --- /dev/null
> +++ b/drivers/iio/adc/ltc2378.c

> +static int ltc2378_refin_setup(struct device *dev, struct ltc2378_state *st)
> +{
> + int ret;
> +
> + /*
> + * The internal reference buffer amplifies both the internal reference
> + * and REFIN by a factor of 2.
> + */
> + ret = devm_regulator_get_enable_read_voltage(dev, "refin");
> + if (ret == -ENODEV) { /* refin is optional */
> + st->ref_uV = st->info->internal_ref_uV * 2;
> + return 0;
> + } else if (ret < 0) {

if (ret < 0)

> + return dev_err_probe(dev, ret, "failed to read refin regulator\n");
> + }
> +
> + st->ref_uV = ret * 2;
> +
> + return 0;
> +}