public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Marcelo Schmitt <marcelo.schmitt@analog.com>
Cc: <linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<lars@metafoo.de>, <Michael.Hennerich@analog.com>,
	<dlechner@baylibre.com>, <nuno.sa@analog.com>, <andy@kernel.org>,
	<robh@kernel.org>, <krzk+dt@kernel.org>, <conor+dt@kernel.org>,
	<linus.walleij@linaro.org>, <brgl@bgdev.pl>, <broonie@kernel.org>,
	<lgirdwood@gmail.com>, <marcelo.schmitt1@gmail.com>
Subject: Re: [PATCH v6 07/12] iio: adc: ad4170: Add support for buffered data capture
Date: Sun, 22 Jun 2025 15:18:17 +0100	[thread overview]
Message-ID: <20250622151817.78eef50d@jic23-huawei> (raw)
In-Reply-To: <c8a14b9cb6fd5de15c2033cfeb1df84b193941b9.1750258776.git.marcelo.schmitt@analog.com>

On Wed, 18 Jun 2025 14:37:30 -0300
Marcelo Schmitt <marcelo.schmitt@analog.com> wrote:

> Extend the AD4170 driver to allow buffered data capture in continuous read
> mode. In continuous read mode, the chip skips the instruction phase and
> outputs just ADC sample data, enabling faster sample rates to be reached.
> The internal channel sequencer always starts sampling from channel 0 and
> channel 0 must be enabled if more than one channel is selected for data
> capture. The scan mask validation callback checks if the aforementioned
> condition is met.
> 
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Hi Marcelo,

One trivial thing below.

> diff --git a/drivers/iio/adc/ad4170.c b/drivers/iio/adc/ad4170.c
> index b229a24b40de..2acd4316b079 100644
> --- a/drivers/iio/adc/ad4170.c
> +++ b/drivers/iio/adc/ad4170.c

>  
> +static int ad4170_trigger_setup(struct iio_dev *indio_dev)
> +{
> +	struct ad4170_state *st = iio_priv(indio_dev);
> +	struct device *dev = &st->spi->dev;
> +	int ret;
> +
> +	st->trig = devm_iio_trigger_alloc(dev, "%s-trig%d",
> +					  indio_dev->name,
> +					  iio_device_id(indio_dev));
> +	if (!st->trig)
> +		return -ENOMEM;
> +
> +	st->trig->ops = &ad4170_trigger_ops;
> +	st->trig->dev.parent = dev;

devm_iio_tigger_alloc() already set this via viio_trigger_alloc()

https://elixir.bootlin.com/linux/v6.15.3/source/drivers/iio/industrialio-trigger.c#L564

> +
> +	iio_trigger_set_drvdata(st->trig, indio_dev);
> +	ret = devm_iio_trigger_register(dev, st->trig);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "Failed to register trigger\n");
> +
> +	indio_dev->trig = iio_trigger_get(st->trig);
> +
> +	return 0;
> +}


  reply	other threads:[~2025-06-22 14:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18 17:33 [PATCH v6 00/12] iio: adc: Add support for AD4170 series of ADCs Marcelo Schmitt
2025-06-18 17:34 ` [PATCH v6 01/12] dt-bindings: iio: adc: Add AD4170 Marcelo Schmitt
2025-06-19 15:35   ` Conor Dooley
2025-06-22 13:44     ` Jonathan Cameron
2025-06-18 17:35 ` [PATCH v6 02/12] iio: adc: Add basic support for AD4170 Marcelo Schmitt
2025-06-22 14:08   ` Jonathan Cameron
2025-06-18 17:36 ` [PATCH v6 03/12] iio: adc: ad4170: Add support for calibration gain Marcelo Schmitt
2025-06-18 17:36 ` [PATCH v6 04/12] iio: adc: ad4170: Add support for calibration bias Marcelo Schmitt
2025-06-18 17:36 ` [PATCH v6 05/12] Documentation: ABI: IIO: Add sinc5+avg to the filter_type_available list Marcelo Schmitt
2025-06-22 14:09   ` Jonathan Cameron
2025-06-18 17:37 ` [PATCH v6 06/12] iio: adc: ad4170: Add digital filter and sample frequency config support Marcelo Schmitt
2025-06-20  2:38   ` kernel test robot
2025-06-22 14:12     ` Jonathan Cameron
2025-06-18 17:37 ` [PATCH v6 07/12] iio: adc: ad4170: Add support for buffered data capture Marcelo Schmitt
2025-06-22 14:18   ` Jonathan Cameron [this message]
2025-06-18 17:37 ` [PATCH v6 08/12] iio: adc: ad4170: Add clock provider support Marcelo Schmitt
2025-06-18 17:38 ` [PATCH v6 09/12] iio: adc: ad4170: Add GPIO controller support Marcelo Schmitt
2025-06-18 17:38 ` [PATCH v6 10/12] iio: adc: ad4170: Add support for internal temperature sensor Marcelo Schmitt
2025-06-18 17:38 ` [PATCH v6 11/12] iio: adc: ad4170: Add support for weigh scale and RTD sensors Marcelo Schmitt
2025-06-18 17:39 ` [PATCH v6 12/12] iio: adc: ad4170: Add timestamp channel Marcelo Schmitt
2025-06-22 14:21   ` 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=20250622151817.78eef50d@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=brgl@bgdev.pl \
    --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=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@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 \
    --cc=nuno.sa@analog.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