Re: [PATCH v2 01/11] iio: adc: ad7887: fix on-chip reference enable logic

From: Andy Shevchenko

Date: Thu Dec 03 2026 - 06:57:00 EST


On Wed, Dec 02, 2026 at 05:05:33PM +0000, Nuno Sá wrote:
> The REF bit in the control register disables the on-chip 2.5 V
> reference when set. Before commit 5483b8d5015b ("iio: adc: ad7887:
> invert/rework external ref logic"), the driver set it when an external
> reference was used. That commit replaced the use_onchip_ref platform
> data flag with the presence of the vref regulator, but kept the
> condition as is. As a result, the bit is now set when there is no
> external reference, so the on-chip reference gets disabled exactly
> when the driver relies on it, and is left enabled when an external
> reference is supplied.
>
> Only disable the on-chip reference when a vref regulator is present.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>

--
With Best Regards,
Andy Shevchenko