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

From: Jonathan Cameron

Date: Sun Feb 01 2026 - 09:42:51 EST


On Sun, 1 Feb 2026 13:40:42 +0100
Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:

> Hi Jonathan,
>
> On Thu, Jan 29, 2026 at 05:58:19PM +0000, Jonathan Cameron wrote:
> > On Wed, 28 Jan 2026 16:38:17 +0100
> > Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:
> >
> > > The DS442x DAC uses sign-magnitude encoding, so -128 cannot be represented.
> > > Previously, passing -128 resulted in a truncated value that programmed 0mA.
> > >
> > > Fix this by validating the input against the 7-bit magnitude limit.
> > > Additionally, refactor the raw access logic to use symmetrical bitwise
> > > operations, replacing the union structure.
> > >
> > > Fixes: d632a2bd8ffc ("iio: dac: ds4422/ds4424 dac driver")
> > > Cc: <stable@xxxxxxxxxxxxxxx>
> > > Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> > Hi Olkesij
> >
> > This is good stuff but, this fails the test of being the minimal fix
> > suited for a trivial backport.
> >
> > The right solution here is split it. Just apply the correct
> > limit in the fix patch, then the refactors in a patch on top of
> > that which most likely won't be backported for stable.
>
> The v1 of this patch was implemented according to the fix patch
> requirements:
> https://lore.kernel.org/all/20260119182424.1660601-5-o.rempel@xxxxxxxxxxxxxx/
>
> May be keep v1 as is and rebase v3 as refactoring stage on top of it?
Perfect.

Thanks!

Jonathan

>
> Best Regards,
> Oleksij