提交 c4f725b5 编写于 作者: K Krzysztof Kozlowski 提交者: Lee Jones

mfd: max14577: Fix IRQ handling after resume if this is not a wakeup source

During suspend the IRQ should be disabled even if this is not a wakeup
source. This is a proper way of fixing the IRQ handling issue during
resume (IRQ handler fails because I2C bus did not resume yet).

When device is suspended and max14577 interrupt is signaled the irq chip
will try to handle it regardless of wakeup source. Device could be woken
up by different IRQ but still the IRQ handler will try to read the
registers over I2C bus and fail because I2C bus won't be ready yet:
	max14577 2-0025: Failed to read IRQ status: -5
Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 360d15d6
......@@ -414,20 +414,18 @@ static int max14577_suspend(struct device *dev)
struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
struct max14577 *max14577 = i2c_get_clientdata(i2c);
if (device_may_wakeup(dev)) {
if (device_may_wakeup(dev))
enable_irq_wake(max14577->irq);
/*
* MUIC IRQ must be disabled during suspend if this is
* a wake up source because it will be handled before
* resuming I2C.
*
* When device is woken up from suspend (e.g. by ADC change),
* an interrupt occurs before resuming I2C bus controller.
* Interrupt handler tries to read registers but this read
* will fail because I2C is still suspended.
*/
disable_irq(max14577->irq);
}
/*
* MUIC IRQ must be disabled during suspend because if it happens
* while suspended it will be handled before resuming I2C.
*
* When device is woken up from suspend (e.g. by ADC change),
* an interrupt occurs before resuming I2C bus controller.
* Interrupt handler tries to read registers but this read
* will fail because I2C is still suspended.
*/
disable_irq(max14577->irq);
return 0;
}
......@@ -437,10 +435,9 @@ static int max14577_resume(struct device *dev)
struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
struct max14577 *max14577 = i2c_get_clientdata(i2c);
if (device_may_wakeup(dev)) {
if (device_may_wakeup(dev))
disable_irq_wake(max14577->irq);
enable_irq(max14577->irq);
}
enable_irq(max14577->irq);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册