Linux Documentation
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Cc: David Lechner <dlechner@baylibre.com>,
	Marcelo Schmitt <marcelo.schmitt@analog.com>,
	linux-iio@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, lars@metafoo.de,
	Michael.Hennerich@analog.com, corbet@lwn.net
Subject: Re: [PATCH v4 1/4] iio: adc: ad4000: Add support for SPI offload
Date: Sat, 12 Apr 2025 11:28:52 +0100	[thread overview]
Message-ID: <20250412112852.19eacac3@jic23-huawei> (raw)
In-Reply-To: <Z_fe69bn90oVjPNk@debian-BULLSEYE-live-builder-AMD64>

On Thu, 10 Apr 2025 12:08:27 -0300
Marcelo Schmitt <marcelo.schmitt1@gmail.com> wrote:

> On 04/09, David Lechner wrote:
> > On 3/27/25 4:24 PM, Marcelo Schmitt wrote:  
> > > FPGA HDL projects can include a PWM generator in addition to SPI-Engine.
> > > The PWM IP is used to trigger SPI-Engine offload modules that in turn set
> > > SPI-Engine to execute transfers to poll data from the ADC. That allows data
> > > to be read at the maximum sample rates. Also, it is possible to set a
> > > specific sample rate by setting the proper PWM duty cycle and related state
> > > parameters, thus allowing an adjustable ADC sample rate when a PWM (offload
> > > trigger) is used in combination with SPI-Engine.
> > > 
> > > Add support for SPI offload.
> > > 
> > > Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> > > ---  
> > 
> > I think I spotted a bug. With that fixed...
> > 
> > Reviewed-by: David Lechner <dlechner@baylibre.com>
> >   
> > > @@ -690,6 +942,15 @@ static int ad4000_prepare_3wire_mode_message(struct ad4000_state *st,
> > >  
> > >  	xfers[1].rx_buf = &st->scan.data;
> > >  	xfers[1].len = BITS_TO_BYTES(chan->scan_type.storagebits);  
> > 
> > Now this needs to be:
> > 
> > 	xfer->len = chan->scan_type.realbits > 16 ? 4 : 2;
> > 
> > Otherwise when there is SPI offload, this could read 2 words because
> > storagebits is always == 32.  
> 
> I've just tested both versions with ADAQ4003 and with AD7687.
> There's no practical difference between the suggestion and what already is in
> IIO testing. I don't mind sending a patch with the change, but don't think it
> fixes anything.
If it is an unnecessary over read in some cases, probably sensible to either
reduce the length or add a comment on why we don't care.

Jonathan

> 
> Thanks,
> Marcelo


  reply	other threads:[~2025-04-12 10:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-27 21:24 [PATCH v4 0/4] iio: adc: ad4000: Add SPI offload support Marcelo Schmitt
2025-03-27 21:24 ` [PATCH v4 1/4] iio: adc: ad4000: Add support for SPI offload Marcelo Schmitt
2025-04-09 17:22   ` David Lechner
2025-04-10 15:08     ` Marcelo Schmitt
2025-04-12 10:28       ` Jonathan Cameron [this message]
2025-03-27 21:24 ` [PATCH v4 2/4] Documentation: iio: ad4000: Add new supported parts Marcelo Schmitt
2025-03-27 21:25 ` [PATCH v4 3/4] Documentation: iio: ad4000: Add IIO Device characteristics section Marcelo Schmitt
2025-03-27 21:25 ` [PATCH v4 4/4] Documentation: iio: ad4000: Describe offload support Marcelo Schmitt
2025-04-06  9:26 ` [PATCH v4 0/4] iio: adc: ad4000: Add SPI " Jonathan Cameron

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=20250412112852.19eacac3@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=corbet@lwn.net \
    --cc=dlechner@baylibre.com \
    --cc=lars@metafoo.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=marcelo.schmitt@analog.com \
    /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