aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/wsp
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/wsp')
-rw-r--r--arch/powerpc/platforms/wsp/opb_pic.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/arch/powerpc/platforms/wsp/opb_pic.c b/arch/powerpc/platforms/wsp/opb_pic.c
index 19f353dfcd03..cb565bf93650 100644
--- a/arch/powerpc/platforms/wsp/opb_pic.c
+++ b/arch/powerpc/platforms/wsp/opb_pic.c
@@ -30,7 +30,7 @@
30static int opb_index = 0; 30static int opb_index = 0;
31 31
32struct opb_pic { 32struct opb_pic {
33 struct irq_host *host; 33 struct irq_domain *host;
34 void *regs; 34 void *regs;
35 int index; 35 int index;
36 spinlock_t lock; 36 spinlock_t lock;
@@ -179,7 +179,7 @@ static struct irq_chip opb_irq_chip = {
179 .irq_set_type = opb_set_irq_type 179 .irq_set_type = opb_set_irq_type
180}; 180};
181 181
182static int opb_host_map(struct irq_host *host, unsigned int virq, 182static int opb_host_map(struct irq_domain *host, unsigned int virq,
183 irq_hw_number_t hwirq) 183 irq_hw_number_t hwirq)
184{ 184{
185 struct opb_pic *opb; 185 struct opb_pic *opb;
@@ -196,20 +196,9 @@ static int opb_host_map(struct irq_host *host, unsigned int virq,
196 return 0; 196 return 0;
197} 197}
198 198
199static int opb_host_xlate(struct irq_host *host, struct device_node *dn, 199static const struct irq_domain_ops opb_host_ops = {
200 const u32 *intspec, unsigned int intsize,
201 irq_hw_number_t *out_hwirq, unsigned int *out_type)
202{
203 /* Interrupt size must == 2 */
204 BUG_ON(intsize != 2);
205 *out_hwirq = intspec[0];
206 *out_type = intspec[1];
207 return 0;
208}
209
210static struct irq_host_ops opb_host_ops = {
211 .map = opb_host_map, 200 .map = opb_host_map,
212 .xlate = opb_host_xlate, 201 .xlate = irq_domain_xlate_twocell,
213}; 202};
214 203
215irqreturn_t opb_irq_handler(int irq, void *private) 204irqreturn_t opb_irq_handler(int irq, void *private)
@@ -263,13 +252,11 @@ struct opb_pic *opb_pic_init_one(struct device_node *dn)
263 goto free_opb; 252 goto free_opb;
264 } 253 }
265 254
266 /* Allocate an irq host so that Linux knows that despite only 255 /* Allocate an irq domain so that Linux knows that despite only
267 * having one interrupt to issue, we're the controller for multiple 256 * having one interrupt to issue, we're the controller for multiple
268 * hardware IRQs, so later we can lookup their virtual IRQs. */ 257 * hardware IRQs, so later we can lookup their virtual IRQs. */
269 258
270 opb->host = irq_alloc_host(dn, IRQ_HOST_MAP_LINEAR, 259 opb->host = irq_domain_add_linear(dn, OPB_NR_IRQS, &opb_host_ops, opb);
271 OPB_NR_IRQS, &opb_host_ops, -1);
272
273 if (!opb->host) { 260 if (!opb->host) {
274 printk(KERN_ERR "opb: Failed to allocate IRQ host!\n"); 261 printk(KERN_ERR "opb: Failed to allocate IRQ host!\n");
275 goto free_regs; 262 goto free_regs;
@@ -277,7 +264,6 @@ struct opb_pic *opb_pic_init_one(struct device_node *dn)
277 264
278 opb->index = opb_index++; 265 opb->index = opb_index++;
279 spin_lock_init(&opb->lock); 266 spin_lock_init(&opb->lock);
280 opb->host->host_data = opb;
281 267
282 /* Disable all interrupts by default */ 268 /* Disable all interrupts by default */
283 opb_out(opb, OPB_MLSASIER, 0); 269 opb_out(opb, OPB_MLSASIER, 0);