From b46c2088da17b8f9210bf0860af88ec533435af9 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Mon, 1 Feb 2016 01:40:51 -0800 Subject: x86: irq: Move irq_router to a per driver priv At present irq_router is declared as a static struct irq_router in arch/x86/cpu/irq.c. Since it's a driver control block, it makes sense to move it to a per driver priv. Adjust existing APIs to accept an additional parameter of irq_router's udevice. Signed-off-by: Bin Meng Reviewed-by: Simon Glass Tested-by: Simon Glass --- arch/x86/lib/pirq_routing.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'arch/x86/lib/pirq_routing.c') diff --git a/arch/x86/lib/pirq_routing.c b/arch/x86/lib/pirq_routing.c index ba41169..3cc6adb 100644 --- a/arch/x86/lib/pirq_routing.c +++ b/arch/x86/lib/pirq_routing.c @@ -14,7 +14,7 @@ static bool irq_already_routed[16]; -static u8 pirq_get_next_free_irq(u8 *pirq, u16 bitmap) +static u8 pirq_get_next_free_irq(struct udevice *dev, u8 *pirq, u16 bitmap) { int i, link; u8 irq = 0; @@ -33,7 +33,7 @@ static u8 pirq_get_next_free_irq(u8 *pirq, u16 bitmap) continue; for (link = 0; link < CONFIG_MAX_PIRQ_LINKS; link++) { - if (pirq_check_irq_routed(link, irq)) { + if (pirq_check_irq_routed(dev, link, irq)) { irq_already_routed[irq] = true; break; } @@ -52,7 +52,7 @@ static u8 pirq_get_next_free_irq(u8 *pirq, u16 bitmap) return irq; } -void pirq_route_irqs(struct irq_info *irq, int num) +void pirq_route_irqs(struct udevice *dev, struct irq_info *irq, int num) { unsigned char irq_slot[MAX_INTX_ENTRIES]; unsigned char pirq[CONFIG_MAX_PIRQ_LINKS]; @@ -80,11 +80,11 @@ void pirq_route_irqs(struct irq_info *irq, int num) } /* translate link value to link number */ - link = pirq_translate_link(link); + link = pirq_translate_link(dev, link); /* yet not routed */ if (!pirq[link]) { - irq = pirq_get_next_free_irq(pirq, bitmap); + irq = pirq_get_next_free_irq(dev, pirq, bitmap); pirq[link] = irq; } else { irq = pirq[link]; @@ -94,7 +94,7 @@ void pirq_route_irqs(struct irq_info *irq, int num) irq_slot[intx] = irq; /* Assign IRQ in the interrupt router */ - pirq_assign_irq(link, irq); + pirq_assign_irq(dev, link, irq); } /* Bus, device, slots IRQs for {A,B,C,D} */ -- cgit v1.1