[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250622151817.78eef50d@jic23-huawei>
Date: Sun, 22 Jun 2025 15:18:17 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Marcelo Schmitt <marcelo.schmitt@...log.com>
Cc: <linux-iio@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-gpio@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<lars@...afoo.de>, <Michael.Hennerich@...log.com>, <dlechner@...libre.com>,
<nuno.sa@...log.com>, <andy@...nel.org>, <robh@...nel.org>,
<krzk+dt@...nel.org>, <conor+dt@...nel.org>, <linus.walleij@...aro.org>,
<brgl@...ev.pl>, <broonie@...nel.org>, <lgirdwood@...il.com>,
<marcelo.schmitt1@...il.com>
Subject: Re: [PATCH v6 07/12] iio: adc: ad4170: Add support for buffered
data capture
On Wed, 18 Jun 2025 14:37:30 -0300
Marcelo Schmitt <marcelo.schmitt@...log.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@...log.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;
> +}
Powered by blists - more mailing lists