aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/ipic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/sysdev/ipic.c')
-rw-r--r--arch/powerpc/sysdev/ipic.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index 95da897f05a7..b50f97811c25 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -672,13 +672,13 @@ static struct irq_chip ipic_edge_irq_chip = {
672 .irq_set_type = ipic_set_irq_type, 672 .irq_set_type = ipic_set_irq_type,
673}; 673};
674 674
675static int ipic_host_match(struct irq_host *h, struct device_node *node) 675static int ipic_host_match(struct irq_domain *h, struct device_node *node)
676{ 676{
677 /* Exact match, unless ipic node is NULL */ 677 /* Exact match, unless ipic node is NULL */
678 return h->of_node == NULL || h->of_node == node; 678 return h->of_node == NULL || h->of_node == node;
679} 679}
680 680
681static int ipic_host_map(struct irq_host *h, unsigned int virq, 681static int ipic_host_map(struct irq_domain *h, unsigned int virq,
682 irq_hw_number_t hw) 682 irq_hw_number_t hw)
683{ 683{
684 struct ipic *ipic = h->host_data; 684 struct ipic *ipic = h->host_data;
@@ -692,26 +692,10 @@ static int ipic_host_map(struct irq_host *h, unsigned int virq,
692 return 0; 692 return 0;
693} 693}
694 694
695static int ipic_host_xlate(struct irq_host *h, struct device_node *ct, 695static struct irq_domain_ops ipic_host_ops = {
696 const u32 *intspec, unsigned int intsize,
697 irq_hw_number_t *out_hwirq, unsigned int *out_flags)
698
699{
700 /* interrupt sense values coming from the device tree equal either
701 * LEVEL_LOW (low assertion) or EDGE_FALLING (high-to-low change)
702 */
703 *out_hwirq = intspec[0];
704 if (intsize > 1)
705 *out_flags = intspec[1];
706 else
707 *out_flags = IRQ_TYPE_NONE;
708 return 0;
709}
710
711static struct irq_host_ops ipic_host_ops = {
712 .match = ipic_host_match, 696 .match = ipic_host_match,
713 .map = ipic_host_map, 697 .map = ipic_host_map,
714 .xlate = ipic_host_xlate, 698 .xlate = irq_domain_xlate_onetwocell,
715}; 699};
716 700
717struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) 701struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
@@ -728,9 +712,8 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
728 if (ipic == NULL) 712 if (ipic == NULL)
729 return NULL; 713 return NULL;
730 714
731 ipic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, 715 ipic->irqhost = irq_domain_add_linear(node, NR_IPIC_INTS,
732 NR_IPIC_INTS, 716 &ipic_host_ops, ipic);
733 &ipic_host_ops, 0);
734 if (ipic->irqhost == NULL) { 717 if (ipic->irqhost == NULL) {
735 kfree(ipic); 718 kfree(ipic);
736 return NULL; 719 return NULL;
@@ -738,8 +721,6 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
738 721
739 ipic->regs = ioremap(res.start, resource_size(&res)); 722 ipic->regs = ioremap(res.start, resource_size(&res));
740 723
741 ipic->irqhost->host_data = ipic;
742
743 /* init hw */ 724 /* init hw */
744 ipic_write(ipic->regs, IPIC_SICNR, 0x0); 725 ipic_write(ipic->regs, IPIC_SICNR, 0x0);
745 726