Re: [PATCH 0/2] iio: dac: add support for AD5413

From: Jonathan Cameron

Date: Sat Nov 28 2026 - 18:55:13 EST


On Tue, 24 Nov 2026 14:07:15 +0000
Nuno Sá <nuno.sa@xxxxxxxxxx> wrote:

> On Thu, Nov 19, 2026 at 07:46:04AM +0000, Tsao, Bruce wrote:
> > On Tue, Nov 03, 2026 at 10:06:08AM +0000, Tsao, Bruce wrote:
> > > David -- since you have the background here: ad5758 currently carries
> > > CRC as a TODO and disables it at probe, whereas the AD5413 implements
> > > per-frame CRC. For the merged driver, would you prefer (a) keeping the
> > > AD5758 CRC-off via the flag (no behaviour change), or (b) also
> > > enabling CRC on the AD5758 to finish that TODO?
> > >
> > > I'll get started on the no-functional-change refactor in the meantime.
> >
> > Hi Jonathan, David, Nuno,
> >
> > A short status update on the v2 rework, plus a gentle ping on the open
> > questions.
> >
> > Status:
> >
> > - ad5758 is now chip_info based: the per-device constants (name,
> > resolution, full scale and the DC-DC/CRC/reset traits) sit in a
> > chip_info selected via the OF/SPI match data. No functional change
> > for the AD5758; I checked this by comparing the generated object code
> > before and after.
> >
> > - The AD5413 is added on top as a second chip_info: compatible and SPI
> > ID, 14-bit data alignment, an optional reset controller (falling back
> > to the existing soft reset) and the avdd/dvdd/avss supplies. These
> > are all per variant, so the AD5758 behaves as before.
> >
> > The main open points are the CRC framing and the output mode, which
> > is where I would like your input.
> >
> > David, I would appreciate your view on the CRC question quoted above.
> >
> > One more point, for David and Nuno: register access still goes
> > through ad5758's own SPI helpers, which is also where the AD5413 CRC
> > would go. Should this series move it to regmap, e.g. with a custom
> > regmap_bus as in ltc2688, or keep the existing helpers?
>
> If the helpers can be reused without much trouble, I'm not seeing a big
> reason on changing to regmap. I do typically prefer custom regmap buses
> but now you need to convert the whole thing so really to you.
>
> As for the CRC, don't just wait for replies. Sometimes things are missed
> :). I would just not change behavior for the existing devices.
>
> >
> > Jonathan, on the output mode (your adi,ch-func pointer on the v1
> > binding): in the ad5758 binding, adi,dc-dc-mode selects voltage or
> > current output and with it which of adi,range-microvolt/-microamp
> > applies. The AD5413 has no DC-DC converter and only one range per mode
> > (+/-10.5 V or 0-24 mA), so only the mode needs describing. Two options
> > for the merged binding:
> >
> > 1) Reuse adi,range-microvolt / adi,range-microamp: an AD5413 node
> > carries exactly one of them, and that selects the mode. No new
> > property.
> >
> > 2) A top-level adi,ch-func (1 = voltage output, 2 = current output),
> > as adi,ad74115.yaml does for its single channel, with the same
> > values ad5710r and max22007 use per channel.

I think option 1 is a bit too obscure even though it does convey the right
info. So I'd do 2 but make sure to highlight it in the dt-binding patch
and we'll see what those folk think of it.

> >
> > Which would you prefer? Or, if you think now is the time for the
> > generic DAC binding you mentioned, I am happy to go that way instead.
> >
> > Jonathan, could you also confirm that you are fine with adding the
> > AD5413 to the ad5758 driver and binding, rather than as a new driver?
> >
>
> Again, my reply now might put this again on Jonathan radar but I would
> say to wait a few more days, take a path and send v2. Worse case
> scenario, Jonathan has other preferences and you need v3 :)

I'm fine with adding it and indeed Nuno's mail meant I noticed
this had an outstanding question!

Thanks,

Jonathan

>
> - Nuno Sá
>
> > Thanks,
> > Bruce