From: Jonathan Cameron <jic23@kernel.org>
To: Francesco Lavra <flavra@baylibre.com>
Cc: "Ramona Gradinariu" <ramona.gradinariu@analog.com>,
"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iio: accel: adxl380: Optimize reading of FIFO entries in interrupt handler
Date: Thu, 22 Jan 2026 19:53:13 +0000 [thread overview]
Message-ID: <20260122195313.53fde73c@jic23-huawei> (raw)
In-Reply-To: <20260119102317.1565417-3-flavra@baylibre.com>
On Mon, 19 Jan 2026 11:23:17 +0100
Francesco Lavra <flavra@baylibre.com> wrote:
> In order to minimize the time required for transferring FIFO data from the
> sensor to the host machine, perform the read from the FIFO in a single call
> to regmap_bulk_read().
It's a call to regmap_noinc_read() not regmap_bulk_read()
I'll fix it.
> This allows reading acceleration data for all 3 axes at 16 kHz
> sampling frequency using a 1MHz I2C bus frequency.
>
> Signed-off-by: Francesco Lavra <flavra@baylibre.com>
> ---
> drivers/iio/accel/adxl380.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/iio/accel/adxl380.c b/drivers/iio/accel/adxl380.c
> index 650cdbffd4a7..e3e6b182eb3d 100644
> --- a/drivers/iio/accel/adxl380.c
> +++ b/drivers/iio/accel/adxl380.c
> @@ -965,14 +965,12 @@ static irqreturn_t adxl380_irq_handler(int irq, void *p)
> return IRQ_HANDLED;
>
> fifo_entries = rounddown(fifo_entries, st->fifo_set_size);
> - for (i = 0; i < fifo_entries; i += st->fifo_set_size) {
> - ret = regmap_noinc_read(st->regmap, ADXL380_FIFO_DATA,
> - &st->fifo_buf[i],
> - 2 * st->fifo_set_size);
> - if (ret)
> - return IRQ_HANDLED;
> + ret = regmap_noinc_read(st->regmap, ADXL380_FIFO_DATA, &st->fifo_buf,
> + sizeof(*st->fifo_buf) * fifo_entries);
> + if (ret)
> + return IRQ_HANDLED;
> + for (i = 0; i < fifo_entries; i += st->fifo_set_size)
> iio_push_to_buffers(indio_dev, &st->fifo_buf[i]);
> - }
>
> return IRQ_HANDLED;
> }
next prev parent reply other threads:[~2026-01-22 19:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-19 10:23 [PATCH v2 0/2] accel: adxl380: Improve data reading from FIFO Francesco Lavra
2026-01-19 10:23 ` [PATCH v2 1/2] iio: accel: adxl380: Avoid reading more entries than present in FIFO Francesco Lavra
2026-01-19 10:23 ` [PATCH v2 2/2] iio: accel: adxl380: Optimize reading of FIFO entries in interrupt handler Francesco Lavra
2026-01-22 19:53 ` Jonathan Cameron [this message]
2026-01-23 8:13 ` Andy Shevchenko
2026-01-23 9:54 ` Jonathan Cameron
2026-01-23 11:09 ` Francesco Lavra
2026-01-23 11:12 ` Andy Shevchenko
2026-01-22 19:54 ` [PATCH v2 0/2] accel: adxl380: Improve data reading from FIFO 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=20260122195313.53fde73c@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=dlechner@baylibre.com \
--cc=flavra@baylibre.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=ramona.gradinariu@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
all inboxes | Powered by JetHome®