From: Jonathan Cameron <jic23@kernel.org>
To: Jean-Baptiste Maneyrol <Jean-Baptiste.Maneyrol@tdk.com>
Cc: "lars@metafoo.de" <lars@metafoo.de>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH 3/4] iio: imu: inv_mpu6050: add new interrupt handler for WoM events
Date: Sat, 9 Mar 2024 17:38:01 +0000 [thread overview]
Message-ID: <20240309173801.05205880@jic23-huawei> (raw)
In-Reply-To: <FR3P281MB1757BE6895EF363ED0ABAE74CE232@FR3P281MB1757.DEUP281.PROD.OUTLOOK.COM>
> >> st->chip_config.magn_fifo_enable))
> >> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
> >> index ec2398a87f45..7ffbb9e7c100 100644
> >> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
> >> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
> >> @@ -6,6 +6,7 @@
> >> #include <linux/pm_runtime.h>
> >>
> >> #include <linux/iio/common/inv_sensors_timestamp.h>
> >> +#include <linux/iio/events.h>
> >>
> >> #include "inv_mpu_iio.h"
> >>
> >> @@ -223,6 +224,52 @@ static const struct iio_trigger_ops inv_mpu_trigger_ops = {
> >> .set_trigger_state = &inv_mpu_data_rdy_trigger_set_state,
> >> };
> >>
> >> +static irqreturn_t inv_mpu6050_interrupt_timestamp(int irq, void *p)
> >> +{
> >> + struct iio_dev *indio_dev = p;
> >> + struct inv_mpu6050_state *st = iio_priv(indio_dev);
> >> +
> >> + st->it_timestamp = iio_get_time_ns(indio_dev);
> >> +
> >> + return IRQ_WAKE_THREAD;
> >
> >I think you can use iio_pollfunc_store_time().
>
> The problem here is that interrupt can happen without buffer/trigger on, when only WoM is on.
> In my understanding, poll function is not attached when buffer is off and poll function is NULL.
Ah ok - I'd missed that mattered here.
next prev parent reply other threads:[~2024-03-09 17:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-25 16:00 [PATCH 0/4] Add WoM feature as an IIO event inv.git-commit
2024-02-25 16:00 ` [PATCH 1/4] iio: imu: inv_mpu6050: add WoM (Wake-on-Motion) sensor inv.git-commit
2024-03-03 16:56 ` Jonathan Cameron
2024-03-04 10:57 ` Jean-Baptiste Maneyrol
2024-02-25 16:00 ` [PATCH 2/4] iio: imu: inv_mpu6050: add WoM event inside accel channels inv.git-commit
2024-03-03 16:58 ` Jonathan Cameron
2024-02-25 16:00 ` [PATCH 3/4] iio: imu: inv_mpu6050: add new interrupt handler for WoM events inv.git-commit
2024-03-03 17:10 ` Jonathan Cameron
2024-03-04 11:11 ` Jean-Baptiste Maneyrol
2024-03-09 17:38 ` Jonathan Cameron [this message]
2024-02-25 16:00 ` [PATCH 4/4] iio: imu: inv_mpu6050: add WoM suspend wakeup with low-power mode inv.git-commit
2024-03-03 16:44 ` [PATCH 0/4] Add WoM feature as an IIO event Jonathan Cameron
2024-03-04 10:50 ` Jean-Baptiste Maneyrol
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=20240309173801.05205880@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jean-Baptiste.Maneyrol@tdk.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.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