Re: [PATCH 0/2] iio: dac: add support for AD5413
From: Tsao, Bruce
Date: Thu Nov 19 2026 - 02:47:35 EST
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?
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.
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?
Thanks,
Bruce