aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/max14577.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c
index 484d372a4892..caaf50c1bd60 100644
--- a/drivers/mfd/max14577.c
+++ b/drivers/mfd/max14577.c
@@ -414,20 +414,18 @@ static int max14577_suspend(struct device *dev)
414 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 414 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
415 struct max14577 *max14577 = i2c_get_clientdata(i2c); 415 struct max14577 *max14577 = i2c_get_clientdata(i2c);
416 416
417 if (device_may_wakeup(dev)) { 417 if (device_may_wakeup(dev))
418 enable_irq_wake(max14577->irq); 418 enable_irq_wake(max14577->irq);
419 /* 419 /*
420 * MUIC IRQ must be disabled during suspend if this is 420 * MUIC IRQ must be disabled during suspend because if it happens
421 * a wake up source because it will be handled before 421 * while suspended it will be handled before resuming I2C.
422 * resuming I2C. 422 *
423 * 423 * When device is woken up from suspend (e.g. by ADC change),
424 * When device is woken up from suspend (e.g. by ADC change), 424 * an interrupt occurs before resuming I2C bus controller.
425 * an interrupt occurs before resuming I2C bus controller. 425 * Interrupt handler tries to read registers but this read
426 * Interrupt handler tries to read registers but this read 426 * will fail because I2C is still suspended.
427 * will fail because I2C is still suspended. 427 */
428 */ 428 disable_irq(max14577->irq);
429 disable_irq(max14577->irq);
430 }
431 429
432 return 0; 430 return 0;
433} 431}
@@ -437,10 +435,9 @@ static int max14577_resume(struct device *dev)
437 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 435 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
438 struct max14577 *max14577 = i2c_get_clientdata(i2c); 436 struct max14577 *max14577 = i2c_get_clientdata(i2c);
439 437
440 if (device_may_wakeup(dev)) { 438 if (device_may_wakeup(dev))
441 disable_irq_wake(max14577->irq); 439 disable_irq_wake(max14577->irq);
442 enable_irq(max14577->irq); 440 enable_irq(max14577->irq);
443 }
444 441
445 return 0; 442 return 0;
446} 443}