Skip to content

Commit 694ab75

Browse files
committed
ASoC: cs35l45: Prevent IRQ handling when suspending/resuming
Use the SYSTEM_SLEEP_PM_OPS handlers to prevent handling an IRQ when the system is in the middle of suspending or resuming. Change-Id: I16d9ad4484e6b687a84234188e6a62114d89b29d Signed-off-by: Ricardo Rivera-Matos <[email protected]> Acked-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 27dfc8a commit 694ab75

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

sound/soc/codecs/cs35l45.c

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,46 @@ static int cs35l45_runtime_resume(struct device *dev)
10261026
return ret;
10271027
}
10281028

1029+
static int cs35l45_sys_suspend(struct device *dev)
1030+
{
1031+
struct cs35l45_private *cs35l45 = dev_get_drvdata(dev);
1032+
1033+
dev_dbg(cs35l45->dev, "System suspend, disabling IRQ\n");
1034+
disable_irq(cs35l45->irq);
1035+
1036+
return 0;
1037+
}
1038+
1039+
static int cs35l45_sys_suspend_noirq(struct device *dev)
1040+
{
1041+
struct cs35l45_private *cs35l45 = dev_get_drvdata(dev);
1042+
1043+
dev_dbg(cs35l45->dev, "Late system suspend, reenabling IRQ\n");
1044+
enable_irq(cs35l45->irq);
1045+
1046+
return 0;
1047+
}
1048+
1049+
static int cs35l45_sys_resume_noirq(struct device *dev)
1050+
{
1051+
struct cs35l45_private *cs35l45 = dev_get_drvdata(dev);
1052+
1053+
dev_dbg(cs35l45->dev, "Early system resume, disabling IRQ\n");
1054+
disable_irq(cs35l45->irq);
1055+
1056+
return 0;
1057+
}
1058+
1059+
static int cs35l45_sys_resume(struct device *dev)
1060+
{
1061+
struct cs35l45_private *cs35l45 = dev_get_drvdata(dev);
1062+
1063+
dev_dbg(cs35l45->dev, "System resume, reenabling IRQ\n");
1064+
enable_irq(cs35l45->irq);
1065+
1066+
return 0;
1067+
}
1068+
10291069
static int cs35l45_apply_property_config(struct cs35l45_private *cs35l45)
10301070
{
10311071
struct device_node *node = cs35l45->dev->of_node;
@@ -1468,6 +1508,9 @@ EXPORT_SYMBOL_NS_GPL(cs35l45_remove, SND_SOC_CS35L45);
14681508

14691509
EXPORT_GPL_DEV_PM_OPS(cs35l45_pm_ops) = {
14701510
RUNTIME_PM_OPS(cs35l45_runtime_suspend, cs35l45_runtime_resume, NULL)
1511+
1512+
SYSTEM_SLEEP_PM_OPS(cs35l45_sys_suspend, cs35l45_sys_resume)
1513+
NOIRQ_SYSTEM_SLEEP_PM_OPS(cs35l45_sys_suspend_noirq, cs35l45_sys_resume_noirq)
14711514
};
14721515

14731516
MODULE_DESCRIPTION("ASoC CS35L45 driver");

0 commit comments

Comments
 (0)