Re: [PATCH v2 01/11] iio: dac: ad5686: fix ref bit initialization for single-channel parts

Andy Shevchenko
2026-04-27T17:53:09Z

On Mon, Apr 27, 2026 at 12:30:08PM +0100, Rodrigo Alencar via B4 Relay wrote:

> The reference bit position was ignored when writing the register at the
> probe() function (!!val was used). When such bit is 1, internal voltage
> reference is disabled so that an external one can be used. For
> multi-channel devices, bit 0 of the Internal Reference Setup command
> behaves the same way, so AD5686_REF_BIT_MSK is created. The issue exists
> since support for single-channel devices were first introduced.

...

> - val = (has_external_vref | ref_bit_msk);
> + val = (has_external_vref) ? ref_bit_msk : 0;

Too many parentheses. If the former had something in mind, the latter really
doesn't need them.

...

Otherwise LGTM!

--
With Best Regards,
Andy Shevchenko