Re: [PATCH v2 6/8] iio: dac: ds4424: fix -128 rejection and refactor raw access

Andy Shevchenko
2026-01-27T10:51:42Z

On Tue, Jan 27, 2026 at 11:49:05AM +0100, Oleksij Rempel wrote:
> On Tue, Jan 27, 2026 at 12:42:24PM +0200, Andy Shevchenko wrote:
> > On Tue, Jan 27, 2026 at 07:09:37AM +0100, Oleksij Rempel wrote:

...

> > > + /*
> > > + * Currents exiting the IC (Source) are positive.
> > > + * Canonicalize 0 to sink; datasheet treats sign as don't-care.
> > > + */
> > > + if (val > 0)
> > > + abs_val |= DS4424_DAC_SOURCE;
> >
> > Hmm... Maybe 0 should be excluded as invalid?
>
> 0 is valid value for no current flow (power off). The direction bit
> DS4424_DAC_SOURCE will just make no difference if value is 0.

Perhaps elaborate this in the comment above?

--
With Best Regards,
Andy Shevchenko