All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jonathan Santos <Jonathan.Santos@analog.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org,
	dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	jonath4nns@gmail.com
Subject: Re: [PATCH v2 4/4] iio: adc: ad7768-1: add support for SPI offload
Date: Mon, 23 Feb 2026 15:46:24 +0200	[thread overview]
Message-ID: <aZxaMPWtxwCvmtdd@smile.fi.intel.com> (raw)
In-Reply-To: <79e1004bd9e618f9376a9ed40389510066b91d1c.1771362939.git.Jonathan.Santos@analog.com>

On Mon, Feb 23, 2026 at 08:59:53AM -0300, Jonathan Santos wrote:
> The AD7768-1 family supports sampling rates up to 1 MSPS, which exceeds
> the capabilities of conventional triggered buffer operations due to SPI
> transaction overhead and interrupt latency.
> 
> Add SPI offload support to enable hardware-accelerated data acquisition
> that bypasses software SPI transactions using continuous data streaming.

...

> +static int ad7768_spi_offload_probe(struct iio_dev *indio_dev,
> +				    struct ad7768_state *st)
> +{
> +	struct device *dev = &st->spi->dev;
> +	struct spi_offload_trigger_info trigger_info = {
> +		.fwnode = dev_fwnode(dev),
> +		.ops = &ad7768_offload_trigger_ops,
> +		.priv = st,
> +	};
> +	struct dma_chan *rx_dma;
> +	int ret;
> +
> +	ret = devm_spi_offload_trigger_register(dev, &trigger_info);
> +	if (ret)
> +		return dev_err_probe(dev, ret,  "failed to register offload trigger\n");

Double space...
(do not resend just for addressing this)

> +	st->offload_trigger = devm_spi_offload_trigger_get(dev, st->offload,
> +							   SPI_OFFLOAD_TRIGGER_DATA_READY);
> +	if (IS_ERR(st->offload_trigger))
> +		return dev_err_probe(dev, PTR_ERR(st->offload_trigger),
> +				     "failed to get offload trigger\n");
> +
> +	rx_dma = devm_spi_offload_rx_stream_request_dma_chan(dev, st->offload);
> +	if (IS_ERR(rx_dma))
> +		return dev_err_probe(dev, PTR_ERR(rx_dma), "failed to get offload RX DMA\n");
> +
> +	ret = devm_iio_dmaengine_buffer_setup_with_handle(dev, indio_dev, rx_dma,
> +							  IIO_BUFFER_DIRECTION_IN);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to setup offload RX DMA\n");
> +
> +	indio_dev->setup_ops = &ad7768_offload_buffer_ops;
> +
> +	return 0;
> +}

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-02-23 13:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 11:59 [PATCH v2 0/4] iio: adc: ad7768-1: add SPI offload support and fixes Jonathan Santos
2026-02-23 11:59 ` [PATCH v2 1/4] iio: adc: ad7768-1: fix one-shot mode data acquisition Jonathan Santos
2026-02-23 11:59 ` [PATCH v2 2/4] iio: adc: ad7768-1: remove switch to one-shot mode Jonathan Santos
2026-02-23 11:59 ` [PATCH v2 3/4] iio: adc: ad7768-1: disable IRQ autoenable Jonathan Santos
2026-02-23 11:59 ` [PATCH v2 4/4] iio: adc: ad7768-1: add support for SPI offload Jonathan Santos
2026-02-23 13:46   ` Andy Shevchenko [this message]
2026-02-28 19:20     ` Jonathan Cameron
2026-02-28 17:18   ` David Lechner
2026-03-01 12:10     ` Jonathan Cameron
2026-02-28 17:19 ` [PATCH v2 0/4] iio: adc: ad7768-1: add SPI offload support and fixes David Lechner

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=aZxaMPWtxwCvmtdd@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=Jonathan.Santos@analog.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=jonath4nns@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.