linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] iio: imu/mpu6050: support dual-edge IRQ
Date: Sat, 11 Jan 2020 12:10:47 +0000	[thread overview]
Message-ID: <20200111121047.79e16365@archlinux> (raw)
In-Reply-To: <e5b39c16dc6dcb25324f6e8389cc0d0f895c1cbd.1578309319.git.mirq-linux@rere.qmqm.pl>

On Mon, 06 Jan 2020 12:17:54 +0100
Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:

> Make mpu6050 usable on platforms which provide only any-edge interrupts.
> This also covers shared interrupt case.

So this had me confused for a bit because I assumed we were trying to make
a level interrupt providing device work with edge interrupts.  Seems
device supports a pulsed  mode and the driver supports this.

Why do we want to detect on both edges?  Do you have a crazy board
with this shared and some devices using the rising edge and some the falling one?

For shared case it should return that it did not handle the interrupt
to allow spurious interrupt detection to work...

Jonathan

> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

> 
> ---
> v2:
>    just remove the dev_warn() message
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
>  drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 +-
>  drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 5 +----
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> index 0686e41bb8a1..b3d138091f89 100644
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> @@ -1241,7 +1241,7 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
>  	irq_type = irqd_get_trigger_type(desc);
>  	if (!irq_type)
>  		irq_type = IRQF_TRIGGER_RISING;
> -	if (irq_type == IRQF_TRIGGER_RISING)
> +	if (irq_type & IRQF_TRIGGER_RISING)	// rising or both-edge
>  		st->irq_mask = INV_MPU6050_ACTIVE_HIGH;
>  	else if (irq_type == IRQF_TRIGGER_FALLING)
>  		st->irq_mask = INV_MPU6050_ACTIVE_LOW;
> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
> index 10d16ec5104b..a4dc2c4a3ca5 100644
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
> @@ -183,11 +183,8 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
>  			"failed to ack interrupt\n");
>  		goto flush_fifo;
>  	}
> -	if (!(int_status & INV_MPU6050_BIT_RAW_DATA_RDY_INT)) {
> -		dev_warn(regmap_get_device(st->map),
> -			"spurious interrupt with status 0x%x\n", int_status);
> +	if (!(int_status & INV_MPU6050_BIT_RAW_DATA_RDY_INT))
>  		goto end_session;
> -	}
>  
>  	if (!(st->chip_config.accl_fifo_enable |
>  		st->chip_config.gyro_fifo_enable |


  parent reply	other threads:[~2020-01-11 12:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-04 16:44 [PATCH] iio: imu/mpu6050: support dual-edge IRQ Michał Mirosław
2020-01-06  9:42 ` Jean-Baptiste Maneyrol
2020-01-06 11:17   ` [PATCH v2] " Michał Mirosław
2020-01-06 16:13     ` Jean-Baptiste Maneyrol
2020-01-11 12:10     ` Jonathan Cameron [this message]
2020-01-11 15:07       ` Michał Mirosław
2020-01-13 22:15         ` 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=20200111121047.79e16365@archlinux \
    --to=jic23@kernel.org \
    --cc=jmaneyrol@invensense.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=pmeerw@pmeerw.net \
    /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;
as well as URLs for NNTP newsgroup(s).