mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-27 15:36:48 +00:00

Add device-managed variant of dev_pm_set_wake_irq which automatically clear the wake irq on device destruction to simplify error handling and resource management in drivers. Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://patch.msgid.link/20250103-wake_irq-v2-1-e3aeff5e9966@nxp.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
43 lines
1009 B
C
43 lines
1009 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/* pm_wakeirq.h - Device wakeirq helper functions */
|
|
|
|
#ifndef _LINUX_PM_WAKEIRQ_H
|
|
#define _LINUX_PM_WAKEIRQ_H
|
|
|
|
#ifdef CONFIG_PM
|
|
|
|
extern int dev_pm_set_wake_irq(struct device *dev, int irq);
|
|
extern int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq);
|
|
extern int dev_pm_set_dedicated_wake_irq_reverse(struct device *dev, int irq);
|
|
extern void dev_pm_clear_wake_irq(struct device *dev);
|
|
extern int devm_pm_set_wake_irq(struct device *dev, int irq);
|
|
|
|
#else /* !CONFIG_PM */
|
|
|
|
static inline int dev_pm_set_wake_irq(struct device *dev, int irq)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int dev_pm_set_dedicated_wake_irq_reverse(struct device *dev, int irq)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void dev_pm_clear_wake_irq(struct device *dev)
|
|
{
|
|
}
|
|
|
|
static inline int devm_pm_set_wake_irq(struct device *dev, int irq)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
#endif /* CONFIG_PM */
|
|
#endif /* _LINUX_PM_WAKEIRQ_H */
|