mirror of
https://github.com/torvalds/linux.git
synced 2024-11-19 18:41:48 +00:00
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>
This commit is contained in:
parent
1d017b6b36
commit
67c9929691
@ -409,6 +409,26 @@ static int arizona_runtime_suspend(struct device *dev)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
#ifdef CONFIG_PM_SLEEP
|
||||||
|
static int arizona_suspend(struct device *dev)
|
||||||
|
{
|
||||||
|
struct arizona *arizona = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
dev_dbg(arizona->dev, "Suspend, disabling IRQ\n");
|
||||||
|
disable_irq(arizona->irq);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int arizona_suspend_late(struct device *dev)
|
||||||
|
{
|
||||||
|
struct arizona *arizona = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
dev_dbg(arizona->dev, "Late suspend, reenabling IRQ\n");
|
||||||
|
enable_irq(arizona->irq);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int arizona_resume_noirq(struct device *dev)
|
static int arizona_resume_noirq(struct device *dev)
|
||||||
{
|
{
|
||||||
struct arizona *arizona = dev_get_drvdata(dev);
|
struct arizona *arizona = dev_get_drvdata(dev);
|
||||||
@ -434,8 +454,9 @@ const struct dev_pm_ops arizona_pm_ops = {
|
|||||||
SET_RUNTIME_PM_OPS(arizona_runtime_suspend,
|
SET_RUNTIME_PM_OPS(arizona_runtime_suspend,
|
||||||
arizona_runtime_resume,
|
arizona_runtime_resume,
|
||||||
NULL)
|
NULL)
|
||||||
SET_SYSTEM_SLEEP_PM_OPS(NULL, arizona_resume)
|
SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
|
||||||
#ifdef CONFIG_PM_SLEEP
|
#ifdef CONFIG_PM_SLEEP
|
||||||
|
.suspend_late = arizona_suspend_late,
|
||||||
.resume_noirq = arizona_resume_noirq,
|
.resume_noirq = arizona_resume_noirq,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user