Skip to content

Commit 2a221c0

Browse files
jwrdegoedejic23
authored andcommitted
iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines
Commit 5ec6486 ("iio:imu: inv_mpu6050: support more interrupt types") causes inv_mpu_core_probe() to fail if the IRQ does not have a trigger-type setup. This happens on machines where the mpu6050 is enumerated through ACPI and an older Interrupt type ACPI resource is used for the interrupt, rather then a GpioInt type type, causing the mpu6050 driver to no longer work there. This happens on e.g. the Asus T100TA. This commits makes the mpu6050 fallback to the old IRQF_TRIGGER_RISING default if the irq-type is not setup, fixing this. Signed-off-by: Hans de Goede <[email protected]> Fixes: 5ec6486 ("iio:imu: inv_mpu6050: support more interrupt types") Reviewed-by: Martin Kelly <[email protected]> Reviewed-by: Jean-Baptiste Maneyrol <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 92397a6 commit 2a221c0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/iio/imu/inv_mpu6050/inv_mpu_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
959959
}
960960

961961
irq_type = irqd_get_trigger_type(desc);
962+
if (!irq_type)
963+
irq_type = IRQF_TRIGGER_RISING;
962964
if (irq_type == IRQF_TRIGGER_RISING)
963965
st->irq_mask = INV_MPU6050_ACTIVE_HIGH;
964966
else if (irq_type == IRQF_TRIGGER_FALLING)

0 commit comments

Comments
 (0)