mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 15:15:47 +00:00
iio: imu/mpu6050: support dual-edge IRQ
Make mpu6050 usable on platforms which provide only any-edge interrupts. One example of this kind of platform is AT91SAM9G45 Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
2e4c0a5e25
commit
84961af78c
2 changed files with 2 additions and 5 deletions
|
@ -1220,7 +1220,7 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
|
||||||
irq_type = irqd_get_trigger_type(desc);
|
irq_type = irqd_get_trigger_type(desc);
|
||||||
if (!irq_type)
|
if (!irq_type)
|
||||||
irq_type = IRQF_TRIGGER_RISING;
|
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;
|
st->irq_mask = INV_MPU6050_ACTIVE_HIGH;
|
||||||
else if (irq_type == IRQF_TRIGGER_FALLING)
|
else if (irq_type == IRQF_TRIGGER_FALLING)
|
||||||
st->irq_mask = INV_MPU6050_ACTIVE_LOW;
|
st->irq_mask = INV_MPU6050_ACTIVE_LOW;
|
||||||
|
|
|
@ -185,11 +185,8 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
|
||||||
"failed to ack interrupt\n");
|
"failed to ack interrupt\n");
|
||||||
goto flush_fifo;
|
goto flush_fifo;
|
||||||
}
|
}
|
||||||
if (!(int_status & INV_MPU6050_BIT_RAW_DATA_RDY_INT)) {
|
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);
|
|
||||||
goto end_session;
|
goto end_session;
|
||||||
}
|
|
||||||
|
|
||||||
if (!(st->chip_config.accl_fifo_enable |
|
if (!(st->chip_config.accl_fifo_enable |
|
||||||
st->chip_config.gyro_fifo_enable |
|
st->chip_config.gyro_fifo_enable |
|
||||||
|
|
Loading…
Reference in a new issue