diff options
author | Jean-Baptiste Maneyrol <[email protected]> | 2024-08-14 14:37:35 +0000 |
---|---|---|
committer | Jonathan Cameron <[email protected]> | 2024-08-17 15:31:41 +0100 |
commit | 0a3b517c8089aa4cf339f41460d542c681409386 (patch) | |
tree | ecaed17ed5d65741c7c0318fff24a0eb7ead28c4 | |
parent | f242967f4d1c024ac42bb47ea50b6360b4cb4556 (diff) |
iio: imu: inv_mpu6050: fix interrupt status read for old buggy chips
Interrupt status read seems to be broken on some old MPU-6050 like
chips. Fix by reverting to previous driver behavior bypassing interrupt
status read. This is working because these chips are not supporting
WoM and data ready is the only interrupt source.
Fixes: 5537f653d9be ("iio: imu: inv_mpu6050: add new interrupt handler for WoM events")
Cc: [email protected]
Signed-off-by: Jean-Baptiste Maneyrol <[email protected]>
Tested-by: Svyatoslav Ryhel <[email protected]> # LG P895
Tested-by: Andreas Westman Dorcsak <[email protected]> # LG P880
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
-rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c index 84273660ca2e..3bfeabab0ec4 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c @@ -248,12 +248,20 @@ static irqreturn_t inv_mpu6050_interrupt_handle(int irq, void *p) int result; switch (st->chip_type) { + case INV_MPU6000: case INV_MPU6050: + case INV_MPU9150: + /* + * WoM is not supported and interrupt status read seems to be broken for + * some chips. Since data ready is the only interrupt, bypass interrupt + * status read and always assert data ready bit. + */ + wom_bits = 0; + int_status = INV_MPU6050_BIT_RAW_DATA_RDY_INT; + goto data_ready_interrupt; case INV_MPU6500: case INV_MPU6515: case INV_MPU6880: - case INV_MPU6000: - case INV_MPU9150: case INV_MPU9250: case INV_MPU9255: wom_bits = INV_MPU6500_BIT_WOM_INT; @@ -279,6 +287,7 @@ static irqreturn_t inv_mpu6050_interrupt_handle(int irq, void *p) } } +data_ready_interrupt: /* handle raw data interrupt */ if (int_status & INV_MPU6050_BIT_RAW_DATA_RDY_INT) { indio_dev->pollfunc->timestamp = st->it_timestamp; |