Commit c1aaaa1cb7c82fe53463fba4928405fddcc4ea27

Authored by Marek Szyprowski
Committed by Lee Jones
1 parent efddff27c8

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>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

drivers/mfd/max8997.c
... ... @@ -448,6 +448,7 @@
448 448 struct i2c_client *i2c = to_i2c_client(dev);
449 449 struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
450 450  
  451 + disable_irq(max8997->irq);
451 452 if (device_may_wakeup(dev))
452 453 irq_set_irq_wake(max8997->irq, 1);
453 454 return 0;
... ... @@ -460,6 +461,7 @@
460 461  
461 462 if (device_may_wakeup(dev))
462 463 irq_set_irq_wake(max8997->irq, 0);
  464 + enable_irq(max8997->irq);
463 465 return max8997_irq_resume(max8997);
464 466 }
465 467