From: Bjorn Helgaas This adds a few updates: - Fix build on ia64 (I8042_MAP_IRQ() isn't defined at compile-time) - Add FixedIO support from Hans-Frieder Vogt - Add ACPI device name (e.g., "PS/2 Keyboard Controller") - Fall back to default ports/IRQ if ACPI _CRS doesn't supply them - Fall back to previous blind probing if ACPI is disabled Signed-off-by: Bjorn Helgaas Signed-off-by: Andrew Morton --- 25-akpm/drivers/input/serio/i8042-x86ia64io.h | 62 ++++++++++++++++++++------ 1 files changed, 49 insertions(+), 13 deletions(-) diff -puN drivers/input/serio/i8042-x86ia64io.h~i8042-acpi-enumeration-update drivers/input/serio/i8042-x86ia64io.h --- 25/drivers/input/serio/i8042-x86ia64io.h~i8042-acpi-enumeration-update Tue Sep 21 14:31:14 2004 +++ 25-akpm/drivers/input/serio/i8042-x86ia64io.h Tue Sep 21 14:31:14 2004 @@ -28,8 +28,8 @@ #define I8042_KBD_IRQ i8042_kbd_irq #define I8042_AUX_IRQ i8042_aux_irq -static int i8042_kbd_irq = I8042_MAP_IRQ(1); -static int i8042_aux_irq = I8042_MAP_IRQ(12); +static int i8042_kbd_irq; +static int i8042_aux_irq; /* * Register numbers. @@ -105,6 +105,7 @@ static acpi_status i8042_acpi_parse_reso { struct i8042_acpi_resources *i8042_res = data; struct acpi_resource_io *io; + struct acpi_resource_fixed_io *fixed_io; struct acpi_resource_irq *irq; struct acpi_resource_ext_irq *ext_irq; @@ -119,6 +120,16 @@ static acpi_status i8042_acpi_parse_reso } break; + case ACPI_RSTYPE_FIXED_IO: + fixed_io = &res->data.fixed_io; + if (fixed_io->range_length) { + if (!i8042_res->port1) + i8042_res->port1 = fixed_io->base_address; + else + i8042_res->port2 = fixed_io->base_address; + } + break; + case ACPI_RSTYPE_IRQ: irq = &res->data.irq; if (irq->number_of_interrupts > 0) @@ -151,13 +162,29 @@ static int i8042_acpi_kbd_add(struct acp if (ACPI_FAILURE(status)) return -ENODEV; - printk("i8042: ACPI %s [%s] at I/O 0x%x, 0x%x, irq %d\n", + if (kbd_res.port1) + i8042_data_reg = kbd_res.port1; + else + printk(KERN_WARNING "ACPI: [%s] has no data port; default is 0x%x\n", + acpi_device_bid(device), i8042_data_reg); + + if (kbd_res.port2) + i8042_command_reg = kbd_res.port2; + else + printk(KERN_WARNING "ACPI: [%s] has no command port; default is 0x%x\n", + acpi_device_bid(device), i8042_command_reg); + + if (kbd_res.irq) + i8042_kbd_irq = kbd_res.irq; + else + printk(KERN_WARNING "ACPI: [%s] has no IRQ; default is %d\n", + acpi_device_bid(device), i8042_kbd_irq); + + strncpy(acpi_device_name(device), "PS/2 Keyboard Controller", + sizeof(acpi_device_name(device))); + printk("ACPI: %s [%s] at I/O 0x%x, 0x%x, irq %d\n", acpi_device_name(device), acpi_device_bid(device), - kbd_res.port1, kbd_res.port2, kbd_res.irq); - - i8042_data_reg = kbd_res.port1; - i8042_command_reg = kbd_res.port2; - i8042_kbd_irq = kbd_res.irq; + i8042_data_reg, i8042_command_reg, i8042_kbd_irq); return 0; } @@ -173,10 +200,16 @@ static int i8042_acpi_aux_add(struct acp if (ACPI_FAILURE(status)) return -ENODEV; - printk("i8042: ACPI %s [%s] at irq %d\n", - acpi_device_name(device), acpi_device_bid(device), aux_res.irq); - - i8042_aux_irq = aux_res.irq; + if (aux_res.irq) + i8042_aux_irq = aux_res.irq; + else + printk(KERN_WARNING "ACPI: [%s] has no IRQ; default is %d\n", + acpi_device_bid(device), i8042_aux_irq); + + strncpy(acpi_device_name(device), "PS/2 Mouse Controller", + sizeof(acpi_device_name(device))); + printk("ACPI: %s [%s] at irq %d\n", + acpi_device_name(device), acpi_device_bid(device), i8042_aux_irq); return 0; } @@ -201,7 +234,7 @@ static int i8042_acpi_init(void) { int result; - if (i8042_noacpi) { + if (acpi_disabled || i8042_noacpi) { printk("i8042: ACPI detection disabled\n"); return 0; } @@ -245,6 +278,9 @@ static inline int i8042_platform_init(vo * return -1; */ + i8042_kbd_irq = I8042_MAP_IRQ(1); + i8042_aux_irq = I8042_MAP_IRQ(12); + #ifdef CONFIG_ACPI if (i8042_acpi_init()) return -1; _