aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2011-03-08 17:27:00 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-03-09 19:04:03 -0500
commit3a0adfab4a9773e70b5448a9dbc785a48d12d713 (patch)
tree797a9c059043fcf15ea5c7ed01179fc21bf765d4
parent41f3863bb050ba881aac6cc7be28fc0602cb629a (diff)
powerpc: sysdev/qe_lib/qe_ic irq_data conversion.
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/include/asm/qe_ic.h19
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.c25
2 files changed, 26 insertions, 18 deletions
diff --git a/arch/powerpc/include/asm/qe_ic.h b/arch/powerpc/include/asm/qe_ic.h
index cf519663a79..9e2cb201916 100644
--- a/arch/powerpc/include/asm/qe_ic.h
+++ b/arch/powerpc/include/asm/qe_ic.h
@@ -81,7 +81,7 @@ int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high);
81static inline void qe_ic_cascade_low_ipic(unsigned int irq, 81static inline void qe_ic_cascade_low_ipic(unsigned int irq,
82 struct irq_desc *desc) 82 struct irq_desc *desc)
83{ 83{
84 struct qe_ic *qe_ic = desc->handler_data; 84 struct qe_ic *qe_ic = get_irq_desc_data(desc);
85 unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); 85 unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic);
86 86
87 if (cascade_irq != NO_IRQ) 87 if (cascade_irq != NO_IRQ)
@@ -91,7 +91,7 @@ static inline void qe_ic_cascade_low_ipic(unsigned int irq,
91static inline void qe_ic_cascade_high_ipic(unsigned int irq, 91static inline void qe_ic_cascade_high_ipic(unsigned int irq,
92 struct irq_desc *desc) 92 struct irq_desc *desc)
93{ 93{
94 struct qe_ic *qe_ic = desc->handler_data; 94 struct qe_ic *qe_ic = get_irq_desc_data(desc);
95 unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); 95 unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic);
96 96
97 if (cascade_irq != NO_IRQ) 97 if (cascade_irq != NO_IRQ)
@@ -101,32 +101,35 @@ static inline void qe_ic_cascade_high_ipic(unsigned int irq,
101static inline void qe_ic_cascade_low_mpic(unsigned int irq, 101static inline void qe_ic_cascade_low_mpic(unsigned int irq,
102 struct irq_desc *desc) 102 struct irq_desc *desc)
103{ 103{
104 struct qe_ic *qe_ic = desc->handler_data; 104 struct qe_ic *qe_ic = get_irq_desc_data(desc);
105 unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); 105 unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic);
106 struct irq_chip *chip = get_irq_desc_chip(desc);
106 107
107 if (cascade_irq != NO_IRQ) 108 if (cascade_irq != NO_IRQ)
108 generic_handle_irq(cascade_irq); 109 generic_handle_irq(cascade_irq);
109 110
110 desc->chip->eoi(irq); 111 chip->irq_eoi(&desc->irq_data);
111} 112}
112 113
113static inline void qe_ic_cascade_high_mpic(unsigned int irq, 114static inline void qe_ic_cascade_high_mpic(unsigned int irq,
114 struct irq_desc *desc) 115 struct irq_desc *desc)
115{ 116{
116 struct qe_ic *qe_ic = desc->handler_data; 117 struct qe_ic *qe_ic = get_irq_desc_data(desc);
117 unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); 118 unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic);
119 struct irq_chip *chip = get_irq_desc_chip(desc);
118 120
119 if (cascade_irq != NO_IRQ) 121 if (cascade_irq != NO_IRQ)
120 generic_handle_irq(cascade_irq); 122 generic_handle_irq(cascade_irq);
121 123
122 desc->chip->eoi(irq); 124 chip->irq_eoi(&desc->irq_data);
123} 125}
124 126
125static inline void qe_ic_cascade_muxed_mpic(unsigned int irq, 127static inline void qe_ic_cascade_muxed_mpic(unsigned int irq,
126 struct irq_desc *desc) 128 struct irq_desc *desc)
127{ 129{
128 struct qe_ic *qe_ic = desc->handler_data; 130 struct qe_ic *qe_ic = get_irq_desc_data(desc);
129 unsigned int cascade_irq; 131 unsigned int cascade_irq;
132 struct irq_chip *chip = get_irq_desc_chip(desc);
130 133
131 cascade_irq = qe_ic_get_high_irq(qe_ic); 134 cascade_irq = qe_ic_get_high_irq(qe_ic);
132 if (cascade_irq == NO_IRQ) 135 if (cascade_irq == NO_IRQ)
@@ -135,7 +138,7 @@ static inline void qe_ic_cascade_muxed_mpic(unsigned int irq,
135 if (cascade_irq != NO_IRQ) 138 if (cascade_irq != NO_IRQ)
136 generic_handle_irq(cascade_irq); 139 generic_handle_irq(cascade_irq);
137 140
138 desc->chip->eoi(irq); 141 chip->irq_eoi(&desc->irq_data);
139} 142}
140 143
141#endif /* _ASM_POWERPC_QE_IC_H */ 144#endif /* _ASM_POWERPC_QE_IC_H */
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c
index 541ba986364..8c9ded8ea07 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -189,15 +189,20 @@ static inline void qe_ic_write(volatile __be32 __iomem * base, unsigned int reg
189 189
190static inline struct qe_ic *qe_ic_from_irq(unsigned int virq) 190static inline struct qe_ic *qe_ic_from_irq(unsigned int virq)
191{ 191{
192 return irq_to_desc(virq)->chip_data; 192 return get_irq_chip_data(virq);
193}
194
195static inline struct qe_ic *qe_ic_from_irq_data(struct irq_data *d)
196{
197 return irq_data_get_irq_chip_data(d);
193} 198}
194 199
195#define virq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq) 200#define virq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq)
196 201
197static void qe_ic_unmask_irq(unsigned int virq) 202static void qe_ic_unmask_irq(struct irq_data *d)
198{ 203{
199 struct qe_ic *qe_ic = qe_ic_from_irq(virq); 204 struct qe_ic *qe_ic = qe_ic_from_irq_data(d);
200 unsigned int src = virq_to_hw(virq); 205 unsigned int src = virq_to_hw(d->irq);
201 unsigned long flags; 206 unsigned long flags;
202 u32 temp; 207 u32 temp;
203 208
@@ -210,10 +215,10 @@ static void qe_ic_unmask_irq(unsigned int virq)
210 raw_spin_unlock_irqrestore(&qe_ic_lock, flags); 215 raw_spin_unlock_irqrestore(&qe_ic_lock, flags);
211} 216}
212 217
213static void qe_ic_mask_irq(unsigned int virq) 218static void qe_ic_mask_irq(struct irq_data *d)
214{ 219{
215 struct qe_ic *qe_ic = qe_ic_from_irq(virq); 220 struct qe_ic *qe_ic = qe_ic_from_irq_data(d);
216 unsigned int src = virq_to_hw(virq); 221 unsigned int src = virq_to_hw(d->irq);
217 unsigned long flags; 222 unsigned long flags;
218 u32 temp; 223 u32 temp;
219 224
@@ -238,9 +243,9 @@ static void qe_ic_mask_irq(unsigned int virq)
238 243
239static struct irq_chip qe_ic_irq_chip = { 244static struct irq_chip qe_ic_irq_chip = {
240 .name = "QEIC", 245 .name = "QEIC",
241 .unmask = qe_ic_unmask_irq, 246 .irq_unmask = qe_ic_unmask_irq,
242 .mask = qe_ic_mask_irq, 247 .irq_mask = qe_ic_mask_irq,
243 .mask_ack = qe_ic_mask_irq, 248 .irq_mask_ack = qe_ic_mask_irq,
244}; 249};
245 250
246static int qe_ic_host_match(struct irq_host *h, struct device_node *node) 251static int qe_ic_host_match(struct irq_host *h, struct device_node *node)