aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-10 07:40:26 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-05-17 11:47:29 -0400
commit67c992969172473e129984a51ceb77950a2aa16c (patch)
tree4ab7c73734a5fc7dad6dab5c8fed9ad823195257
parent1d017b6b36675574ec8a6f7dbcd3fd3bec2dc03f (diff)
mfd: arizona: Disable interrupts during suspend
We aren't able to handle interrupts after the device has suspended since we need to runtime resume it in order to do so but the controller may not be available any more. Handle this in the same way as we handle a similar issue on resume. Reported-by: Chuansheng Liu <chuansheng.liu@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--drivers/mfd/arizona-core.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 8002e2d2f6fe..549db0ad7257 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -409,6 +409,26 @@ static int arizona_runtime_suspend(struct device *dev)
409#endif 409#endif
410 410
411#ifdef CONFIG_PM_SLEEP 411#ifdef CONFIG_PM_SLEEP
412static int arizona_suspend(struct device *dev)
413{
414 struct arizona *arizona = dev_get_drvdata(dev);
415
416 dev_dbg(arizona->dev, "Suspend, disabling IRQ\n");
417 disable_irq(arizona->irq);
418
419 return 0;
420}
421
422static int arizona_suspend_late(struct device *dev)
423{
424 struct arizona *arizona = dev_get_drvdata(dev);
425
426 dev_dbg(arizona->dev, "Late suspend, reenabling IRQ\n");
427 enable_irq(arizona->irq);
428
429 return 0;
430}
431
412static int arizona_resume_noirq(struct device *dev) 432static int arizona_resume_noirq(struct device *dev)
413{ 433{
414 struct arizona *arizona = dev_get_drvdata(dev); 434 struct arizona *arizona = dev_get_drvdata(dev);
@@ -434,8 +454,9 @@ const struct dev_pm_ops arizona_pm_ops = {
434 SET_RUNTIME_PM_OPS(arizona_runtime_suspend, 454 SET_RUNTIME_PM_OPS(arizona_runtime_suspend,
435 arizona_runtime_resume, 455 arizona_runtime_resume,
436 NULL) 456 NULL)
437 SET_SYSTEM_SLEEP_PM_OPS(NULL, arizona_resume) 457 SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
438#ifdef CONFIG_PM_SLEEP 458#ifdef CONFIG_PM_SLEEP
459 .suspend_late = arizona_suspend_late,
439 .resume_noirq = arizona_resume_noirq, 460 .resume_noirq = arizona_resume_noirq,
440#endif 461#endif
441}; 462};