diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-02-23 13:00:56 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-23 17:26:49 +0100 |
commit | ff973d041e5ab9ada9e49f4e93ef3a699c511463 (patch) | |
tree | f5fee6d9934d98df18cdeb571a200ddc83562f28 /arch/x86/kernel/apic | |
parent | ed972ccf434a9881a5881915ae04602af2776bad (diff) | |
download | linux-ff973d041e5ab9ada9e49f4e93ef3a699c511463.tar.gz linux-ff973d041e5ab9ada9e49f4e93ef3a699c511463.tar.bz2 linux-ff973d041e5ab9ada9e49f4e93ef3a699c511463.zip |
x86: ioapic: Add io_apic_setup_irq_pin()
There are about four places in the ioapic code which do exactly the
same setup sequence. Also the OF based ioapic setup needs that
function to avoid putting the OF specific code into ioapic.c
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index f751a82d4cb4..6deb3ca62fd6 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -3607,6 +3607,21 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev) } #endif /* CONFIG_HT_IRQ */ +int +io_apic_setup_irq_pin(unsigned int irq, int node, struct io_apic_irq_attr *attr) +{ + struct irq_cfg *cfg = alloc_irq_and_cfg_at(irq, node); + int ret; + + if (!cfg) + return -EINVAL; + ret = __add_pin_to_irq_node(cfg, node, attr->ioapic, attr->ioapic_pin); + if (!ret) + setup_ioapic_irq(attr->ioapic, attr->ioapic_pin, irq, cfg, + attr->trigger, attr->polarity); + return ret; +} + int __init io_apic_get_redir_entries (int ioapic) { union IO_APIC_reg_01 reg_01; |