summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/max77693.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2014-10-10 12:48:35 +0200
committerLee Jones <lee.jones@linaro.org>2014-11-10 15:22:02 +0000
commitc0acb8144bd6d8d88aee1dab33364b7353e9a903 (patch)
treee550be461691a6ded09c5eff61cf580120ffd92d /drivers/mfd/max77693.c
parent43fc9396cac3f7498e07a22e6a987b911462fa58 (diff)
downloadlinux-c0acb8144bd6d8d88aee1dab33364b7353e9a903.tar.gz
linux-c0acb8144bd6d8d88aee1dab33364b7353e9a903.tar.bz2
linux-c0acb8144bd6d8d88aee1dab33364b7353e9a903.zip
mfd: max77693: Fix always masked MUIC interrupts
All interrupts coming from MUIC were ignored because interrupt source register was masked. The Maxim 77693 has a "interrupt source" - a separate register and interrupts which give information about PMIC block triggering the individual interrupt (charger, topsys, MUIC, flash LED). By default bootloader could initialize this register to "mask all" value. In such case (observed on Trats2 board) MUIC interrupts won't be generated regardless of their mask status. Regmap irq chip was unmasking individual MUIC interrupts but the source was masked Before introducing regmap irq chip this interrupt source was unmasked, read and acked. Reading and acking is not necessary but unmasking is. Fixes: 342d669c1ee4 ("mfd: max77693: Handle IRQs using regmap") Cc: <stable@vger.kernel.org> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/max77693.c')
-rw-r--r--drivers/mfd/max77693.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c
index 22d23fcbb65c..711773e8e64b 100644
--- a/drivers/mfd/max77693.c
+++ b/drivers/mfd/max77693.c
@@ -250,6 +250,17 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
goto err_irq_muic;
}
+ /* Unmask interrupts from all blocks in interrupt source register */
+ ret = regmap_update_bits(max77693->regmap,
+ MAX77693_PMIC_REG_INTSRC_MASK,
+ SRC_IRQ_ALL, (unsigned int)~SRC_IRQ_ALL);
+ if (ret < 0) {
+ dev_err(max77693->dev,
+ "Could not unmask interrupts in INTSRC: %d\n",
+ ret);
+ goto err_intsrc;
+ }
+
pm_runtime_set_active(max77693->dev);
ret = mfd_add_devices(max77693->dev, -1, max77693_devs,
@@ -261,6 +272,7 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
err_mfd:
mfd_remove_devices(max77693->dev);
+err_intsrc:
regmap_del_irq_chip(max77693->irq, max77693->irq_data_muic);
err_irq_muic:
regmap_del_irq_chip(max77693->irq, max77693->irq_data_charger);