summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2018-09-05 16:36:06 +0200
committerLee Jones <lee.jones@linaro.org>2018-10-23 08:58:34 +0100
commitc1aaaa1cb7c82fe53463fba4928405fddcc4ea27 (patch)
treedbd515f2d147ea8c7bb2b164021ec26758d6864a /drivers/mfd
parentefddff27c886e729a7f84a7205bd84d7d4af7336 (diff)
mfd: max8997: Disable interrupt handling for suspend/resume cycle
Disable IRQs during suspend/resume cycle to ensure handling of wakeup interrupts (i.e. RTC wake alarm) after max8997_resume(). This way it can be properly handled when I2C bus is finally available. This pattern is also used in other MAX PMIC MFD drivers. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/max8997.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index f99e8da99782..8c06c09e36d1 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -448,6 +448,7 @@ static int max8997_suspend(struct device *dev)
struct i2c_client *i2c = to_i2c_client(dev);
struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
+ disable_irq(max8997->irq);
if (device_may_wakeup(dev))
irq_set_irq_wake(max8997->irq, 1);
return 0;
@@ -460,6 +461,7 @@ static int max8997_resume(struct device *dev)
if (device_may_wakeup(dev))
irq_set_irq_wake(max8997->irq, 0);
+ enable_irq(max8997->irq);
return max8997_irq_resume(max8997);
}