diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/qe_ic.h | 68 |
1 files changed, 67 insertions, 1 deletions
diff --git a/include/asm-powerpc/qe_ic.h b/include/asm-powerpc/qe_ic.h index e386fb7e44b0..a779b2c9eaf1 100644 --- a/include/asm-powerpc/qe_ic.h +++ b/include/asm-powerpc/qe_ic.h | |||
@@ -56,9 +56,75 @@ enum qe_ic_grp_id { | |||
56 | QE_IC_GRP_RISCB /* QE interrupt controller RISC group B */ | 56 | QE_IC_GRP_RISCB /* QE interrupt controller RISC group B */ |
57 | }; | 57 | }; |
58 | 58 | ||
59 | void qe_ic_init(struct device_node *node, unsigned int flags); | 59 | void qe_ic_init(struct device_node *node, unsigned int flags, |
60 | void (*low_handler)(unsigned int irq, struct irq_desc *desc), | ||
61 | void (*high_handler)(unsigned int irq, struct irq_desc *desc)); | ||
60 | void qe_ic_set_highest_priority(unsigned int virq, int high); | 62 | void qe_ic_set_highest_priority(unsigned int virq, int high); |
61 | int qe_ic_set_priority(unsigned int virq, unsigned int priority); | 63 | int qe_ic_set_priority(unsigned int virq, unsigned int priority); |
62 | int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high); | 64 | int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high); |
63 | 65 | ||
66 | struct qe_ic; | ||
67 | unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic); | ||
68 | unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic); | ||
69 | |||
70 | static inline void qe_ic_cascade_low_ipic(unsigned int irq, | ||
71 | struct irq_desc *desc) | ||
72 | { | ||
73 | struct qe_ic *qe_ic = desc->handler_data; | ||
74 | unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); | ||
75 | |||
76 | if (cascade_irq != NO_IRQ) | ||
77 | generic_handle_irq(cascade_irq); | ||
78 | } | ||
79 | |||
80 | static inline void qe_ic_cascade_high_ipic(unsigned int irq, | ||
81 | struct irq_desc *desc) | ||
82 | { | ||
83 | struct qe_ic *qe_ic = desc->handler_data; | ||
84 | unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); | ||
85 | |||
86 | if (cascade_irq != NO_IRQ) | ||
87 | generic_handle_irq(cascade_irq); | ||
88 | } | ||
89 | |||
90 | static inline void qe_ic_cascade_low_mpic(unsigned int irq, | ||
91 | struct irq_desc *desc) | ||
92 | { | ||
93 | struct qe_ic *qe_ic = desc->handler_data; | ||
94 | unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); | ||
95 | |||
96 | if (cascade_irq != NO_IRQ) | ||
97 | generic_handle_irq(cascade_irq); | ||
98 | |||
99 | desc->chip->eoi(irq); | ||
100 | } | ||
101 | |||
102 | static inline void qe_ic_cascade_high_mpic(unsigned int irq, | ||
103 | struct irq_desc *desc) | ||
104 | { | ||
105 | struct qe_ic *qe_ic = desc->handler_data; | ||
106 | unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); | ||
107 | |||
108 | if (cascade_irq != NO_IRQ) | ||
109 | generic_handle_irq(cascade_irq); | ||
110 | |||
111 | desc->chip->eoi(irq); | ||
112 | } | ||
113 | |||
114 | static inline void qe_ic_cascade_muxed_mpic(unsigned int irq, | ||
115 | struct irq_desc *desc) | ||
116 | { | ||
117 | struct qe_ic *qe_ic = desc->handler_data; | ||
118 | unsigned int cascade_irq; | ||
119 | |||
120 | cascade_irq = qe_ic_get_high_irq(qe_ic); | ||
121 | if (cascade_irq == NO_IRQ) | ||
122 | cascade_irq = qe_ic_get_low_irq(qe_ic); | ||
123 | |||
124 | if (cascade_irq != NO_IRQ) | ||
125 | generic_handle_irq(cascade_irq); | ||
126 | |||
127 | desc->chip->eoi(irq); | ||
128 | } | ||
129 | |||
64 | #endif /* _ASM_POWERPC_QE_IC_H */ | 130 | #endif /* _ASM_POWERPC_QE_IC_H */ |