aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/qe_lib/qe_ic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/sysdev/qe_lib/qe_ic.c')
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c
index 73034bd203c4..2fba6ef2f95e 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -245,13 +245,13 @@ static struct irq_chip qe_ic_irq_chip = {
245 .irq_mask_ack = qe_ic_mask_irq, 245 .irq_mask_ack = qe_ic_mask_irq,
246}; 246};
247 247
248static int qe_ic_host_match(struct irq_host *h, struct device_node *node) 248static int qe_ic_host_match(struct irq_domain *h, struct device_node *node)
249{ 249{
250 /* Exact match, unless qe_ic node is NULL */ 250 /* Exact match, unless qe_ic node is NULL */
251 return h->of_node == NULL || h->of_node == node; 251 return h->of_node == NULL || h->of_node == node;
252} 252}
253 253
254static int qe_ic_host_map(struct irq_host *h, unsigned int virq, 254static int qe_ic_host_map(struct irq_domain *h, unsigned int virq,
255 irq_hw_number_t hw) 255 irq_hw_number_t hw)
256{ 256{
257 struct qe_ic *qe_ic = h->host_data; 257 struct qe_ic *qe_ic = h->host_data;
@@ -272,23 +272,10 @@ static int qe_ic_host_map(struct irq_host *h, unsigned int virq,
272 return 0; 272 return 0;
273} 273}
274 274
275static int qe_ic_host_xlate(struct irq_host *h, struct device_node *ct, 275static struct irq_domain_ops qe_ic_host_ops = {
276 const u32 * intspec, unsigned int intsize,
277 irq_hw_number_t * out_hwirq,
278 unsigned int *out_flags)
279{
280 *out_hwirq = intspec[0];
281 if (intsize > 1)
282 *out_flags = intspec[1];
283 else
284 *out_flags = IRQ_TYPE_NONE;
285 return 0;
286}
287
288static struct irq_host_ops qe_ic_host_ops = {
289 .match = qe_ic_host_match, 276 .match = qe_ic_host_match,
290 .map = qe_ic_host_map, 277 .map = qe_ic_host_map,
291 .xlate = qe_ic_host_xlate, 278 .xlate = irq_domain_xlate_onetwocell,
292}; 279};
293 280
294/* Return an interrupt vector or NO_IRQ if no interrupt is pending. */ 281/* Return an interrupt vector or NO_IRQ if no interrupt is pending. */
@@ -339,8 +326,8 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags,
339 if (qe_ic == NULL) 326 if (qe_ic == NULL)
340 return; 327 return;
341 328
342 qe_ic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, 329 qe_ic->irqhost = irq_domain_add_linear(node, NR_QE_IC_INTS,
343 NR_QE_IC_INTS, &qe_ic_host_ops, 0); 330 &qe_ic_host_ops, qe_ic);
344 if (qe_ic->irqhost == NULL) { 331 if (qe_ic->irqhost == NULL) {
345 kfree(qe_ic); 332 kfree(qe_ic);
346 return; 333 return;
@@ -348,7 +335,6 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags,
348 335
349 qe_ic->regs = ioremap(res.start, resource_size(&res)); 336 qe_ic->regs = ioremap(res.start, resource_size(&res));
350 337
351 qe_ic->irqhost->host_data = qe_ic;
352 qe_ic->hc_irq = qe_ic_irq_chip; 338 qe_ic->hc_irq = qe_ic_irq_chip;
353 339
354 qe_ic->virq_high = irq_of_parse_and_map(node, 0); 340 qe_ic->virq_high = irq_of_parse_and_map(node, 0);