public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Petre Rodan <petre.rodan@subdimension.ro>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 11/14] iio: accel: bma220: add interrupt trigger
Date: Wed, 10 Sep 2025 19:15:20 +0100	[thread overview]
Message-ID: <20250910191520.69d2427e@jic23-huawei> (raw)
In-Reply-To: <20250910-bma220_improvements-v2-11-e23f4f2b9745@subdimension.ro>

On Wed, 10 Sep 2025 10:57:16 +0300
Petre Rodan <petre.rodan@subdimension.ro> wrote:

> Add interrupt trigger.
> 
> Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>

One small thing inline,

Thanks,

Jonathan


>  static irqreturn_t bma220_trigger_handler(int irq, void *p)
>  {
>  	int ret;
> @@ -418,6 +437,25 @@ static void bma220_deinit(void *data_ptr)
>  			 ERR_PTR(ret));
>  }
>  
> +static irqreturn_t bma220_irq_handler(int irq, void *private)
> +{
> +	struct iio_dev *indio_dev = private;
> +	struct bma220_data *data = iio_priv(indio_dev);
> +	int rv;
> +	u8 bma220_reg_if[2];
> +
> +	guard(mutex)(&data->lock);
> +	rv = regmap_bulk_read(data->regmap, BMA220_REG_IF0, bma220_reg_if,
> +			      sizeof(bma220_reg_if));

Given SPI needs DMA safe buffers and theory at least regmap could
have optimizations that don't bounce data in bulk accesses, please
use a DMA safe buffer here.  Put one at the end of iio_priv().
Can share a cacheline with the scan.

> +	if (rv)
> +		return IRQ_NONE;
> +
> +	if (FIELD_GET(BMA220_IF_DRDY, bma220_reg_if[1]))
> +		iio_trigger_poll_nested(data->trig);
> +
> +	return IRQ_HANDLED;
> +}



  reply	other threads:[~2025-09-10 18:15 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10  7:57 [PATCH v2 00/14] iio: accel: bma220 improvements Petre Rodan
2025-09-10  7:57 ` [PATCH v2 01/14] dt-bindings: iio: accel: bosch,bma220 cleanup typo Petre Rodan
2025-09-11  7:31   ` Krzysztof Kozlowski
2025-09-10  7:57 ` [PATCH v2 02/14] dt-bindings: iio: accel: bosch,bma220 setup SPI clock mode Petre Rodan
2025-09-10 17:48   ` Jonathan Cameron
2025-09-11  7:31   ` Krzysztof Kozlowski
2025-09-10  7:57 ` [PATCH v2 03/14] dt-bindings: iio: accel: bosch,bma220 change irq type Petre Rodan
2025-09-11  7:33   ` Krzysztof Kozlowski
2025-09-11  9:53     ` Petre Rodan
2025-09-10  7:57 ` [PATCH v2 04/14] iio: accel: bma220: split original driver Petre Rodan
2025-09-10 17:56   ` Jonathan Cameron
2025-09-11 19:01   ` David Lechner
2025-09-10  7:57 ` [PATCH v2 05/14] iio: accel: bma220: add open firmware table Petre Rodan
2025-09-10  7:57 ` [PATCH v2 06/14] iio: accel: bma220: add get regulator check Petre Rodan
2025-09-10 17:58   ` Jonathan Cameron
2025-09-10 18:51     ` Petre Rodan
2025-09-10 20:28       ` Andy Shevchenko
2025-09-10  7:57 ` [PATCH v2 07/14] iio: accel: bma220: reset registers during init stage Petre Rodan
2025-09-10 18:01   ` Jonathan Cameron
2025-09-11  7:35   ` Krzysztof Kozlowski
2025-09-11 12:36     ` Petre Rodan
2025-09-11 13:07       ` Krzysztof Kozlowski
2025-09-11 13:52         ` Petre Rodan
2025-09-11 13:59           ` Andy Shevchenko
2025-09-11 13:44       ` David Lechner
2025-09-12 14:24         ` Jonathan Cameron
2025-09-11 19:14   ` David Lechner
2025-09-10  7:57 ` [PATCH v2 08/14] iio: accel: bma220: migrate to regmap API Petre Rodan
2025-09-10 18:12   ` Jonathan Cameron
2025-09-12 14:54     ` Petre Rodan
2025-09-13 12:22       ` Jonathan Cameron
2025-09-10  7:57 ` [PATCH v2 09/14] iio: accel: bma220: add i2c module Petre Rodan
2025-09-11 19:23   ` David Lechner
2025-09-10  7:57 ` [PATCH v2 10/14] iio: accel: bma220: add i2c watchdog feature Petre Rodan
2025-09-10  7:57 ` [PATCH v2 11/14] iio: accel: bma220: add interrupt trigger Petre Rodan
2025-09-10 18:15   ` Jonathan Cameron [this message]
2025-09-10  7:57 ` [PATCH v2 12/14] iio: accel: bma220: add LPF cut-off frequency mapping Petre Rodan
2025-09-10 18:16   ` Jonathan Cameron
2025-09-10  7:57 ` [PATCH v2 13/14] iio: accel: bma220: add debugfs reg access Petre Rodan
2025-09-10  7:57 ` [PATCH v2 14/14] iio: accel: bma220: add maintainer Petre Rodan
2025-09-10 18:18 ` [PATCH v2 00/14] iio: accel: bma220 improvements 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=20250910191520.69d2427e@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=petre.rodan@subdimension.ro \
    --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