Skip to content

Commit

Permalink
mfd: max8997: Disable interrupt handling for suspend/resume cycle
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marek Szyprowski authored and Lee Jones committed Oct 23, 2018
1 parent efddff2 commit c1aaaa1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mfd/max8997.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand Down

0 comments on commit c1aaaa1

Please sign in to comment.