aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/interrupt.h14
-rw-r--r--kernel/irq/manage.c21
2 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 70741e170114..db2a63a11633 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -36,6 +36,20 @@ extern void free_irq(unsigned int, void *);
36extern void disable_irq_nosync(unsigned int irq); 36extern void disable_irq_nosync(unsigned int irq);
37extern void disable_irq(unsigned int irq); 37extern void disable_irq(unsigned int irq);
38extern void enable_irq(unsigned int irq); 38extern void enable_irq(unsigned int irq);
39
40/* IRQ wakeup (PM) control: */
41extern int set_irq_wake(unsigned int irq, unsigned int on);
42
43static inline int enable_irq_wake(unsigned int irq)
44{
45 return set_irq_wake(irq, 1);
46}
47
48static inline int disable_irq_wake(unsigned int irq)
49{
50 return set_irq_wake(irq, 0);
51}
52
39#endif 53#endif
40 54
41#ifndef __ARCH_SET_SOFTIRQ_PENDING 55#ifndef __ARCH_SET_SOFTIRQ_PENDING
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index b61784ee78b2..3ed7aee84865 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -133,6 +133,27 @@ void enable_irq(unsigned int irq)
133} 133}
134EXPORT_SYMBOL(enable_irq); 134EXPORT_SYMBOL(enable_irq);
135 135
136/**
137 * set_irq_wake - control irq power management wakeup
138 * @irq: interrupt to control
139 * @on: enable/disable power management wakeup
140 *
141 * Enable/disable power management wakeup mode
142 */
143int set_irq_wake(unsigned int irq, unsigned int on)
144{
145 struct irq_desc *desc = irq_desc + irq;
146 unsigned long flags;
147 int ret = -ENXIO;
148
149 spin_lock_irqsave(&desc->lock, flags);
150 if (desc->chip->set_wake)
151 ret = desc->chip->set_wake(irq, on);
152 spin_unlock_irqrestore(&desc->lock, flags);
153 return ret;
154}
155EXPORT_SYMBOL(set_irq_wake);
156
136/* 157/*
137 * Internal function that tells the architecture code whether a 158 * Internal function that tells the architecture code whether a
138 * particular irq has been exclusively allocated or is available 159 * particular irq has been exclusively allocated or is available