1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Chained IRQ handlers support.
5 * Copyright (C) 2011 ARM Ltd.
7 #ifndef __IRQCHIP_CHAINED_IRQ_H
8 #define __IRQCHIP_CHAINED_IRQ_H
10 #include <linux/irq.h>
13 * Entry/exit functions for chained handlers where the primary IRQ chip
14 * may implement either fasteoi or level-trigger flow control.
16 static inline void chained_irq_enter(struct irq_chip *chip,
17 struct irq_desc *desc)
19 /* FastEOI controllers require no action on entry. */
23 if (chip->irq_mask_ack) {
24 chip->irq_mask_ack(&desc->irq_data);
26 chip->irq_mask(&desc->irq_data);
28 chip->irq_ack(&desc->irq_data);
32 static inline void chained_irq_exit(struct irq_chip *chip,
33 struct irq_desc *desc)
36 chip->irq_eoi(&desc->irq_data);
38 chip->irq_unmask(&desc->irq_data);
41 #endif /* __IRQCHIP_CHAINED_IRQ_H */