]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
mfd: twl6040: Clear the interrupt ID register before requesting IRQ
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Tue, 1 Apr 2014 13:45:01 +0000 (16:45 +0300)
committerLee Jones <lee.jones@linaro.org>
Tue, 3 Jun 2014 07:11:19 +0000 (08:11 +0100)
If for some reason the boot loader enabled the audpwron GPIO we will have
pending IRQs to be handled. This seams to break twl6040 for some reason
leading to non working i2c communication (i2c timeouts). Clearing the INTID
register after we requested the audpwron GPIO (and set it to low) will
ensure that the chip will operate normally in this case as well.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/twl6040.c

index 6e88f25832fb23a13198a1b2f5ca8170b9e04772..03dbff3597a2451f49708e414d993adb65841990 100644 (file)
@@ -679,6 +679,9 @@ static int twl6040_probe(struct i2c_client *client,
                                            GPIOF_OUT_INIT_LOW, "audpwron");
                if (ret)
                        goto gpio_err;
+
+               /* Clear any pending interrupt */
+               twl6040_reg_read(twl6040, TWL6040_REG_INTID);
        }
 
        ret = regmap_add_irq_chip(twl6040->regmap, twl6040->irq, IRQF_ONESHOT,