RE: [PATCH 0/2] iio: dac: add support for AD5413
From: Tsao, Bruce
Date: Tue Oct 20 2026 - 07:57:48 EST
On Mon, Oct 19, 2026 at 11:46:26AM +0300, Andy Shevchenko wrote:
> Why in a brand new driver?
Thanks for taking a look.
The nearest existing driver is ad5758, and the two parts are closely
related at the register level (the DAC_CONFIG RANGE field, DIGITAL_DIAG,
the slew-rate block, the reset and calibration-refresh keys), so an
ad5758 variant is certainly feasible -- that was the first option I
considered.
The differences are a mix of hardware and current implementation:
- Hardware: the AD5758 integrates a DC-DC converter (adi,dc-dc-mode is
mandatory in its DT parse and currently drives channel selection) that
the AD5413 does not have; the AD5413 is also 14-bit rather than 16-bit
and supports a different set of ranges.
- Current implementation: ad5758 disables the SPI CRC at probe, whereas
the AD5413 driver keeps it on and computes a CRC-8 per outgoing frame
(CRC is optional on the AD5413 too); the two also use different reset
APIs.
None of this makes a shared driver impossible -- there's a genuine
common layer (two-stage readback, read-modify-write, the
reset/calibration/slew/output-enable sequences). I went with a
self-contained driver mainly to keep the change off existing ad5758
users and keep the blast radius small, at the cost of some duplication.
That's a tradeoff rather than a hard line, so if you or Jonathan would
prefer AD5413 as an ad5758 variant, I'm happy to prototype it; I'd just
like to agree the direction before spinning a v2.
Thanks,
Bruce