diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2014-04-01 09:45:01 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-06-03 03:11:19 -0400 |
commit | 02d02728ea8bb33dee221d7dcfeb3022d7635927 (patch) | |
tree | 51134bd51a5043d5f0cdacc893ecae2ad0263027 /drivers/mfd/twl6040.c | |
parent | d137be00ee017bc40e6027cb66d667a2e0b450fd (diff) |
mfd: twl6040: Clear the interrupt ID register before requesting IRQ
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>
Diffstat (limited to 'drivers/mfd/twl6040.c')
-rw-r--r-- | drivers/mfd/twl6040.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mfd/twl6040.c b/drivers/mfd/twl6040.c index 6e88f25832fb..03dbff3597a2 100644 --- a/drivers/mfd/twl6040.c +++ b/drivers/mfd/twl6040.c | |||
@@ -679,6 +679,9 @@ static int twl6040_probe(struct i2c_client *client, | |||
679 | GPIOF_OUT_INIT_LOW, "audpwron"); | 679 | GPIOF_OUT_INIT_LOW, "audpwron"); |
680 | if (ret) | 680 | if (ret) |
681 | goto gpio_err; | 681 | goto gpio_err; |
682 | |||
683 | /* Clear any pending interrupt */ | ||
684 | twl6040_reg_read(twl6040, TWL6040_REG_INTID); | ||
682 | } | 685 | } |
683 | 686 | ||
684 | ret = regmap_add_irq_chip(twl6040->regmap, twl6040->irq, IRQF_ONESHOT, | 687 | ret = regmap_add_irq_chip(twl6040->regmap, twl6040->irq, IRQF_ONESHOT, |