diff mbox

[4.18,REGRESSION,fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines

Message ID SN1PR12MB2525A7EBE42E70E91CF4EFF2C4700@SN1PR12MB2525.namprd12.prod.outlook.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jean-Baptiste Maneyrol June 19, 2018, 7:44 a.m. UTC
From: Hans de Goede <hdegoede@redhat.com>
Sent: Monday, June 18, 2018 18:09
To: Jonathan Cameron
Cc: Hans de Goede; Hartmut Knaack; Lars-Peter Clausen; Peter Meerwald-Stadler; linux-iio@vger.kernel.org; Martin Kelly; Jean-Baptiste Maneyrol
Subject: [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines
  

CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.


Commit 5ec6486daa98 ("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.

Fixes: 5ec6486daa98 ("iio:imu: inv_mpu6050: support more interrupt types")
Cc: Martin Kelly <mkelly@xevo.com>
Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 ++
 1 file changed, 2 insertions(+)

--
2.17.1


Good catch indeed, thanks for testing and verifying.

Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index f9c0624505a2..42618fe4f83e 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -959,6 +959,8 @@  int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
        }

        irq_type = irqd_get_trigger_type(desc);
+       if (!irq_type)
+               irq_type = IRQF_TRIGGER_RISING;
        if (irq_type == IRQF_TRIGGER_RISING)
                st->irq_mask = INV_MPU6050_ACTIVE_HIGH;
        else if (irq_type == IRQF_TRIGGER_FALLING)