From cb24b98043cff863c5062e78f4a02f54df01e94a Mon Sep 17 00:00:00 2001 From: Len Brown Date: Mon, 20 Oct 2003 14:31:27 -0400 Subject: [PATCH] [ACPI] fix !CONFIG_PCI build use X86 ACPI specific version of eisa_set_level_irq() http://bugzilla.kernel.org/show_bug.cgi?id=1390 --- arch/i386/kernel/acpi/boot.c | 28 ++++++++++++++++++++++++++++ drivers/acpi/bus.c | 4 ++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 4ad7874ab76c7..218a7c900e5b5 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c @@ -247,6 +247,34 @@ acpi_parse_nmi_src ( #endif /*CONFIG_X86_IO_APIC*/ +#ifdef CONFIG_ACPI_BUS +/* + * Set specified PIC IRQ to level triggered mode. + * + * Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers + * for the 8259 PIC. bit[n] = 1 means irq[n] is Level, otherwise Edge. + * ECLR1 is IRQ's 0-7 (IRQ 0, 1, 2 must be 0) + * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0) + * + * As the BIOS should have done this for us, + * print a warning if the IRQ wasn't already set to level. + */ + +void acpi_pic_set_level_irq(unsigned int irq) +{ + unsigned char mask = 1 << (irq & 7); + unsigned int port = 0x4d0 + (irq >> 3); + unsigned char val = inb(port); + + if (!(val & mask)) { + printk(KERN_WARNING PREFIX "IRQ %d was Edge Triggered, " + "setting to Level Triggerd\n", irq); + outb(val | mask, port); + } +} +#endif /* CONFIG_ACPI_BUS */ + + static unsigned long __init acpi_scan_rsdp ( diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index dc3663b2234ac..d72afc5cc3488 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -39,7 +39,7 @@ #define _COMPONENT ACPI_BUS_COMPONENT ACPI_MODULE_NAME ("acpi_bus") -extern void eisa_set_level_irq(unsigned int irq); +extern void acpi_pic_set_level_irq(unsigned int irq); FADT_DESCRIPTOR acpi_fadt; struct acpi_device *acpi_root; @@ -615,7 +615,7 @@ acpi_bus_init (void) if (acpi_ioapic) mp_config_ioapic_for_sci(acpi_fadt.sci_int); else - eisa_set_level_irq(acpi_fadt.sci_int); + acpi_pic_set_level_irq(acpi_fadt.sci_int); #endif status = acpi_enable_subsystem(ACPI_FULL_INITIALIZATION); -- 2.53.0