Commit bcaf14d8 authored by Len Brown's avatar Len Brown Committed by Len Brown

[ACPI] Move the "only do this once" stuff from acpi_register_gsi() into

eisa_set_level().
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent c8fd81a0
......@@ -456,16 +456,10 @@ unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
* Make sure all (legacy) PCI IRQs are set as level-triggered.
*/
if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
static u16 irq_mask;
extern void eisa_set_level_irq(unsigned int irq);
if (edge_level == ACPI_LEVEL_SENSITIVE) {
if ((gsi < 16) && !((1 << gsi) & irq_mask)) {
Dprintk(KERN_DEBUG PREFIX "Setting GSI %u as level-triggered\n", gsi);
irq_mask |= (1 << gsi);
if (edge_level == ACPI_LEVEL_SENSITIVE)
eisa_set_level_irq(gsi);
}
}
}
#endif
......
......@@ -127,8 +127,15 @@ void eisa_set_level_irq(unsigned int irq)
{
unsigned char mask = 1 << (irq & 7);
unsigned int port = 0x4d0 + (irq >> 3);
unsigned char val = inb(port);
unsigned char val;
static u16 eisa_irq_mask;
if (irq >= 16 || (1 << irq) & eisa_irq_mask)
return;
eisa_irq_mask |= (1 << irq);
printk("PCI: setting IRQ %u as level-triggered\n", irq);
val = inb(port);
if (!(val & mask)) {
DBG(" -> edge");
outb(val | mask, port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment