mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: "Tsao, Bruce" <bruce.tsao@analog.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	David Lechner <dlechner@baylibre.com>,
	"Sa, Nuno" <Nuno.Sa@analog.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: Wed, 21 Oct 2026 09:19:02 +0300	[thread overview]
Message-ID: <athZVjaGYmCyuNrW@ashevche-desk.local> (raw)
In-Reply-To: <DS2PR03MB84188FD41F8847EEB34759D9FB672@DS2PR03MB8418.namprd03.prod.outlook.com>

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.

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2026-10-21  6:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 19:23 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 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 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 [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=athZVjaGYmCyuNrW@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=Nuno.Sa@analog.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

all inboxes | Powered by JetHome®