aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/irqchip/chained_irq.h
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2013-01-18 10:31:37 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2013-03-26 12:11:43 -0400
commitde88cbb7b244f3bcd61d49fd6dec35c19192545a (patch)
tree790dff780e6bcdf2c9e71baa7beb92102ec99526 /include/linux/irqchip/chained_irq.h
parentf36a3bb1a1b73a60f4df1d4c38c686cc173f50b3 (diff)
arm: Move chained_irq_(enter|exit) to a generic file
These functions have been introduced by commit 10a8c383 (irq: introduce entry and exit functions for chained handlers) in asm/mach/irq.h. This patch moves them to linux/irqchip/chained_irq.h so that generic irqchip drivers do not rely on architecture specific header files. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Tested-by: Marc Zyngier <marc.zyngier@arm.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'include/linux/irqchip/chained_irq.h')
-rw-r--r--include/linux/irqchip/chained_irq.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/include/linux/irqchip/chained_irq.h b/include/linux/irqchip/chained_irq.h
new file mode 100644
index 000000000000..adf4c30f3af6
--- /dev/null
+++ b/include/linux/irqchip/chained_irq.h
@@ -0,0 +1,52 @@
1/*
2 * Chained IRQ handlers support.
3 *
4 * Copyright (C) 2011 ARM Ltd.
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18#ifndef __IRQCHIP_CHAINED_IRQ_H
19#define __IRQCHIP_CHAINED_IRQ_H
20
21#include <linux/irq.h>
22
23/*
24 * Entry/exit functions for chained handlers where the primary IRQ chip
25 * may implement either fasteoi or level-trigger flow control.
26 */
27static inline void chained_irq_enter(struct irq_chip *chip,
28 struct irq_desc *desc)
29{
30 /* FastEOI controllers require no action on entry. */
31 if (chip->irq_eoi)
32 return;
33
34 if (chip->irq_mask_ack) {
35 chip->irq_mask_ack(&desc->irq_data);
36 } else {
37 chip->irq_mask(&desc->irq_data);
38 if (chip->irq_ack)
39 chip->irq_ack(&desc->irq_data);
40 }
41}
42
43static inline void chained_irq_exit(struct irq_chip *chip,
44 struct irq_desc *desc)
45{
46 if (chip->irq_eoi)
47 chip->irq_eoi(&desc->irq_data);
48 else
49 chip->irq_unmask(&desc->irq_data);
50}
51
52#endif /* __IRQCHIP_CHAINED_IRQ_H */