Devicetree
 help / color / mirror / Atom feed
From: "Nuno Sá" <nuno.sa@analog.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Tsao, Bruce" <bruce.tsao@analog.com>,
	Jonathan Cameron <jic23@kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	David Lechner <dlechner@baylibre.com>,
	Andy Shevchenko <andy@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/2] iio: dac: add support for AD5413
Date: Mon, 2 Nov 2026 10:52:22 +0000	[thread overview]
Message-ID: <auhqSGR84LUTjBS7@nsa> (raw)
In-Reply-To: <athZVjaGYmCyuNrW@ashevche-desk.local>

On Wed, Oct 21, 2026 at 09:19:02AM +0300, Andy Shevchenko wrote:
> On Tue, Oct 20, 2026 at 11:53:53AM +0000, Tsao, Bruce wrote:
> > 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.
> 
> I also would let David to comment as he has an expertise in the combining
> drivers (if I'm not mistaken). In any case he is also an official reviewer
> of IIO and might have some good ideas.
> 
> From my perspective sounds like there is not enough justification for
> a brand new driver. I remember seeing such a configurations (as per your
> item 1) just be provided via driver data depending on the compatible line.
> As for your item 2, I saw some development for CRC case in another driver
> and IIRC David driven that activity and he might give a better view.
> 

Yeah, tbh I did not even questioned using an existing driver
(internally). Normally I just assume that work was already done but need
to ask the question you did more times :).

If the differences boil down to what was stated in here, seems to me to
merging the device in the existing driver is very much doable and right.
Normally, if the register map+ fits, that's a good indication we can
integrate the device in an existing driver.

- Nuno Sá

> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 

      reply	other threads:[~2026-11-02 10:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 19:23 [PATCH 0/2] iio: dac: add support for AD5413 Bruce Tsao via B4 Relay
2026-10-16 19:23 ` [PATCH 1/2] dt-bindings: iio: dac: Document Analog Devices AD5413 single-channel DAC Bruce Tsao via B4 Relay
2026-10-16 19:36   ` sashiko-bot
2026-10-16 23:02   ` Jonathan Cameron
2026-10-16 19:23 ` [PATCH 2/2] iio: dac: add AD5413 driver Bruce Tsao via B4 Relay
2026-10-16 19:33   ` sashiko-bot
2026-10-16 23:40   ` Jonathan Cameron
2026-10-19  8:46 ` [PATCH 0/2] iio: dac: add support for AD5413 Andy Shevchenko
2026-10-20 11:53   ` Tsao, Bruce
2026-10-21  6:19     ` Andy Shevchenko
2026-11-02 10:52       ` Nuno Sá [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=auhqSGR84LUTjBS7@nsa \
    --to=nuno.sa@analog.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=bruce.tsao@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox