Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Chained IRQ handlers support.
0004  *
0005  * Copyright (C) 2011 ARM Ltd.
0006  */
0007 #ifndef __IRQCHIP_CHAINED_IRQ_H
0008 #define __IRQCHIP_CHAINED_IRQ_H
0009 
0010 #include <linux/irq.h>
0011 
0012 /*
0013  * Entry/exit functions for chained handlers where the primary IRQ chip
0014  * may implement either fasteoi or level-trigger flow control.
0015  */
0016 static inline void chained_irq_enter(struct irq_chip *chip,
0017                      struct irq_desc *desc)
0018 {
0019     /* FastEOI controllers require no action on entry. */
0020     if (chip->irq_eoi)
0021         return;
0022 
0023     if (chip->irq_mask_ack) {
0024         chip->irq_mask_ack(&desc->irq_data);
0025     } else {
0026         chip->irq_mask(&desc->irq_data);
0027         if (chip->irq_ack)
0028             chip->irq_ack(&desc->irq_data);
0029     }
0030 }
0031 
0032 static inline void chained_irq_exit(struct irq_chip *chip,
0033                     struct irq_desc *desc)
0034 {
0035     if (chip->irq_eoi)
0036         chip->irq_eoi(&desc->irq_data);
0037     else
0038         chip->irq_unmask(&desc->irq_data);
0039 }
0040 
0041 #endif /* __IRQCHIP_CHAINED_IRQ_H */