Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31078
b: refs/heads/master
c: ba9a233
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner authored and Linus Torvalds committed Jun 29, 2006
1 parent bfeab0d commit 5c3171a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a55713ab456d267815fd5ca3c3d0fd14301f306
refs/heads/master: ba9a2331bae5da8f65be3722b9e2d210f1987857
14 changes: 14 additions & 0 deletions trunk/include/linux/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ extern void free_irq(unsigned int, void *);
extern void disable_irq_nosync(unsigned int irq);
extern void disable_irq(unsigned int irq);
extern void enable_irq(unsigned int irq);

/* IRQ wakeup (PM) control: */
extern int set_irq_wake(unsigned int irq, unsigned int on);

static inline int enable_irq_wake(unsigned int irq)
{
return set_irq_wake(irq, 1);
}

static inline int disable_irq_wake(unsigned int irq)
{
return set_irq_wake(irq, 0);
}

#endif

#ifndef __ARCH_SET_SOFTIRQ_PENDING
Expand Down
21 changes: 21 additions & 0 deletions trunk/kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,27 @@ void enable_irq(unsigned int irq)
}
EXPORT_SYMBOL(enable_irq);

/**
* set_irq_wake - control irq power management wakeup
* @irq: interrupt to control
* @on: enable/disable power management wakeup
*
* Enable/disable power management wakeup mode
*/
int set_irq_wake(unsigned int irq, unsigned int on)
{
struct irq_desc *desc = irq_desc + irq;
unsigned long flags;
int ret = -ENXIO;

spin_lock_irqsave(&desc->lock, flags);
if (desc->chip->set_wake)
ret = desc->chip->set_wake(irq, on);
spin_unlock_irqrestore(&desc->lock, flags);
return ret;
}
EXPORT_SYMBOL(set_irq_wake);

/*
* Internal function that tells the architecture code whether a
* particular irq has been exclusively allocated or is available
Expand Down

0 comments on commit 5c3171a

Please sign in to comment.