Re: [PATCH 3/4] iio: imu: inv_mpu6050: add new interrupt handler for WoM events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> >>  		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.





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux