public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Angelo Dureghello <adureghello@baylibre.com>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Nuno Sá" <nuno.sa@analog.com>, "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Olivier Moysan" <olivier.moysan@foss.st.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, "Mark Brown" <broonie@kernel.org>,
	dlechner@baylibre.com
Subject: Re: [PATCH v8 7/8] iio: dac: ad3552r: add high-speed platform driver
Date: Mon, 28 Oct 2024 20:00:57 +0000	[thread overview]
Message-ID: <20241028200057.369dcd58@jic23-huawei> (raw)
In-Reply-To: <3boluky2zvz6n4u3gjgxuzlo2cm3a4xcbfq5sjmzoz3i5lfsml@j3wikyf74xyj>

On Mon, 28 Oct 2024 10:14:25 +0100
Angelo Dureghello <adureghello@baylibre.com> wrote:

> Hi Jonathan,
> 
> On 26.10.2024 18:57, Jonathan Cameron wrote:
> > On Fri, 25 Oct 2024 11:49:40 +0200
> > Angelo Dureghello <adureghello@baylibre.com> wrote:
> >   
> > > From: Angelo Dureghello <adureghello@baylibre.com>
> > > 
> > > Add High Speed ad3552r platform driver.
> > > 
> > > The ad3552r DAC is controlled by a custom (fpga-based) DAC IP
> > > through the current AXI backend, or similar alternative IIO backend.
> > > 
> > > Compared to the existing driver (ad3552r.c), that is a simple SPI
> > > driver, this driver is coupled with a DAC IIO backend that finally
> > > controls the ad3552r by a fpga-based "QSPI+DDR" interface, to reach
> > > maximum transfer rate of 33MUPS using dma stream capabilities.
> > > 
> > > All commands involving QSPI bus read/write are delegated to the backend
> > > through the provided APIs for bus read/write.
> > > 
> > > Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
> > > ---  
> > Hi Angelo,
> > 
> > I'd missed a build issue in previous reviews. :(
> >   
> > >  drivers/iio/dac/Kconfig      |  14 ++
> > >  drivers/iio/dac/Makefile     |   1 +
> > >  drivers/iio/dac/ad3552r-hs.c | 530 +++++++++++++++++++++++++++++++++++++++++++
> > >  drivers/iio/dac/ad3552r-hs.h |  19 ++
> > >  drivers/iio/dac/ad3552r.h    |   4 +
> > >  5 files changed, 568 insertions(+)
> > > 
> > > diff --git a/drivers/iio/dac/Kconfig b/drivers/iio/dac/Kconfig
> > > index 26f9de55b79f..f76eaba140d8 100644
> > > --- a/drivers/iio/dac/Kconfig
> > > +++ b/drivers/iio/dac/Kconfig
> > > @@ -6,6 +6,20 @@
> > >  
> > >  menu "Digital to analog converters"
> > >  
> > > +config AD3552R_HS
> > > +	tristate "Analog Devices AD3552R DAC High Speed driver"
> > > +	select ADI_AXI_DAC
> > > +	help
> > > +	  Say yes here to build support for Analog Devices AD3552R
> > > +	  Digital to Analog Converter High Speed driver.
> > > +
> > > +          The driver requires the assistance of an IP core to operate,
> > > +          since data is streamed into target device via DMA, sent over a
> > > +	  QSPI + DDR (Double Data Rate) bus.  
> > 
> > Tabs and space mix that needs fixing.
> >   
> > > +
> > > +	  To compile this driver as a module, choose M here: the
> > > +	  module will be called ad3552r-hs.
> > > +
> > >  config AD3552R
> > >  	tristate "Analog Devices AD3552R DAC driver"
> > >  	depends on SPI_MASTER
> > > diff --git a/drivers/iio/dac/Makefile b/drivers/iio/dac/Makefile
> > > index c92de0366238..d92e08ca93ca 100644
> > > --- a/drivers/iio/dac/Makefile
> > > +++ b/drivers/iio/dac/Makefile
> > > @@ -4,6 +4,7 @@
> > >  #
> > >  
> > >  # When adding new entries keep the list in alphabetical order
> > > +obj-$(CONFIG_AD3552R_HS) += ad3552r-hs.o ad3552r-common.o
> > >  obj-$(CONFIG_AD3552R) += ad3552r.o ad3552r-common.o  
> > 
> > This causes all sorts of issues. The same code should not be linked into two
> > separate drivers.  Try building one as a module and one built in.
> >   
> right now, seems i cannot catch any issue, nor building or in runtime:
> 
> ad3552r     [M]
> ad3552r-hs  [*]
> (ad3552r-common stays built in), ad3552r visible in lsmod, ad3552r-hs works
> 
> ad3552r     [*]
> ad3552r-hs  [M]
> (ad3552r-common stays built in), ad3552r-hs visible in lsmod, ad3552r-hs works
> 
> ad3552r     [M]
> ad3552r-hs  [M]
> (ad3552r-common.ko), ad3552r, ad3552r-hs and ad3552r-common are visible in lsmod,
> ad3552r-hs works, probe and removal, and also link/unlink tested).
> 
> Please let me know, i can proceed modifying as you require, if it's the case.
Hi Angelo,

I can't remember exactly what triggers this; maybe it's no longer a problem.
However, if nothing else it is a waste to end up with two copies in the
drivers. Hence switch to a common library module still a good idea.

Also this is missing includes for bitfield.h in ad3352r.c and ad3552r-common.c
so doesn't build for me at all.

Jonathan

> 
> 
> > The trick is a hidden symbol in Kconfig and an extra line in here
> > obj-$(CONFIG_AD3352R_LIB) += ad3552-common.o
> > 
> > and 
> > //note no text as we don't want this to be user selectable
> > 
> > config AD3352R_LIB
> > 	tristate
> > 
> > config AD3552R_HS
> > 	tristate "Analog Devices AD3552R DAC High Speed driver"
> > 	select ADI_AXI_DAC
> > 	select AD3352R_LIB
> > 	help
> > 	  Say yes here to build support for Analog Devices AD3552R
> > 	  Digital to Analog Converter High Speed driver.
> > 
> > 	  The driver requires the assistance of an IP core to operate,
> > 	  since data is streamed into target device via DMA, sent over a
> > 	  QSPI + DDR (Double Data Rate) bus.
> > 
> > 	  To compile this driver as a module, choose M here: the
> > 	  module will be called ad3552r-hs.
> > 
> > 
> > config AD3552R
> >  	tristate "Analog Devices AD3552R DAC driver"
> >  	depends on SPI_MASTER
> > 	select AD3352R_LIB
> > 	help
> > 	  ...
> > 
> > The pressure/mpl115 is done like this.
> > 
> >   
> > >  obj-$(CONFIG_AD5360) += ad5360.o
> > >  obj-$(CONFIG_AD5380) += ad5380.o  
> > 
> > Anyhow, to me the code looks ready to go subject to this.
> > 
> > If nothing else comes up I'm almost confident enough of the fix to just
> > do it (and the few trivial things in previous review), but probably quicker
> > and less prone to error if you have time to spin a v9, perhaps after letting others
> > have a day or two to review v8 next week.
> > 
> > rc5 is tomorrow, so we have a little time left this cycle.
> > 
> > Jonathan  
> 
> Regards,
>   angelo


  reply	other threads:[~2024-10-28 20:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-25  9:49 [PATCH v8 0/8] iio: add support for the ad3552r AXI DAC IP Angelo Dureghello
2024-10-25  9:49 ` [PATCH v8 1/8] dt-bindings: iio: dac: ad3552r: add iio backend support Angelo Dureghello
2024-10-25  9:49 ` [PATCH v8 2/8] dt-bindings: iio: dac: adi-axi-dac: add ad3552r axi variant Angelo Dureghello
2024-10-27 22:40   ` Rob Herring (Arm)
2024-10-25  9:49 ` [PATCH v8 3/8] iio: backend: extend features Angelo Dureghello
2024-10-25  9:49 ` [PATCH v8 4/8] iio: dac: adi-axi-dac: " Angelo Dureghello
2024-10-28 13:20   ` Nuno Sá
2024-10-25  9:49 ` [PATCH v8 5/8] iio: dac: ad3552r: changes to use FIELD_PREP Angelo Dureghello
2024-10-25  9:49 ` [PATCH v8 6/8] iio: dac: ad3552r: extract common code (no changes in behavior intended) Angelo Dureghello
2024-10-26 17:47   ` Jonathan Cameron
2024-10-25  9:49 ` [PATCH v8 7/8] iio: dac: ad3552r: add high-speed platform driver Angelo Dureghello
2024-10-26 17:57   ` Jonathan Cameron
2024-10-28  9:14     ` Angelo Dureghello
2024-10-28 20:00       ` Jonathan Cameron [this message]
2024-10-28 13:34   ` Nuno Sá
2024-10-28 19:09     ` Angelo Dureghello
2024-10-25  9:49 ` [PATCH v8 8/8] iio: dac: adi-axi-dac: add registering of child fdt node Angelo Dureghello
2024-10-28 13:21   ` Nuno Sá

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=20241028200057.369dcd58@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=adureghello@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=olivier.moysan@foss.st.com \
    --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