2004-09-21 19:53:09

by Bjorn Helgaas

[permalink] [raw]
Subject: [PATCH 2.6.9-rc2-mm1] i8042 ACPI enumeration update

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

I'd appreciate any comments or feedback. If it looks reasonable,
please include this in the next -mm patchset.

Signed-off-by: Bjorn Helgaas <[email protected]>

diff -u -ur 2.6.9-rc2-mm1/drivers/input/serio/i8042-x86ia64io.h kbd4/drivers/input/serio/i8042-x86ia64io.h
--- 2.6.9-rc2-mm1/drivers/input/serio/i8042-x86ia64io.h 2004-09-21 12:51:48.000000000 -0600
+++ kbd4/drivers/input/serio/i8042-x86ia64io.h 2004-09-21 13:06:33.000000000 -0600
@@ -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 @@
{
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 @@
}
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 @@
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 @@
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 @@
{
int result;

- if (i8042_noacpi) {
+ if (acpi_disabled || i8042_noacpi) {
printk("i8042: ACPI detection disabled\n");
return 0;
}
@@ -245,6 +278,9 @@
* 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;


2004-09-21 20:54:33

by J.A. Magallon

[permalink] [raw]
Subject: Re: [PATCH 2.6.9-rc2-mm1] i8042 ACPI enumeration update


On 2004.09.21, Bjorn Helgaas wrote:
> 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
>
> I'd appreciate any comments or feedback. If it looks reasonable,
> please include this in the next -mm patchset.
>
> Signed-off-by: Bjorn Helgaas <[email protected]>
>

Perhaps this cures my kbd/mouse disdetections (it fails somteimes at boot,
I suddenly find myself without mouse or keyboard. Replugging works.

But...your mailer has screwed the patch, tabs were changed to spaces...

Please, could you resend it ?

TIA

--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandrakelinux release 10.1 (Community) for i586
Linux 2.6.9-rc2-mm1 (gcc 3.4.1 (Mandrakelinux (Alpha 3.4.1-3mdk)) #2


2004-09-22 05:09:55

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: [PATCH 2.6.9-rc2-mm1] i8042 ACPI enumeration update

On Tue, Sep 21, 2004 at 01:52:22PM -0600, Bjorn Helgaas wrote:

> 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
>
> I'd appreciate any comments or feedback. If it looks reasonable,
> please include this in the next -mm patchset.
>
> Signed-off-by: Bjorn Helgaas <[email protected]>

Could you send me the complete patch (as opposed to this differential
one)? I think it's probably time to include it into the input tree as it
seems functional enough.

--
Vojtech Pavlik
SuSE Labs, SuSE CR

2004-09-22 15:20:05

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH 2.6.9-rc2-mm1] i8042 ACPI enumeration update

On Tuesday 21 September 2004 11:09 pm, Vojtech Pavlik wrote:
> Could you send me the complete patch (as opposed to this differential
> one)? I think it's probably time to include it into the input tree as it
> seems functional enough.

Here it is. This includes allow-i8042-register-location-override-2.patch
from the -mm patchset and the differential patch I sent yesterday.

Attached rather than inline because I haven't figured out how to
unbreak Kmail-1.7's tab to space conversions.


Attachments:
(No filename) (490.00 B)
diffs.kbd (12.70 kB)
Download all attachments

2004-09-24 09:40:44

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: [PATCH 2.6.9-rc2-mm1] i8042 ACPI enumeration update

On Wed, Sep 22, 2004 at 09:19:24AM -0600, Bjorn Helgaas wrote:
> On Tuesday 21 September 2004 11:09 pm, Vojtech Pavlik wrote:
> > Could you send me the complete patch (as opposed to this differential
> > one)? I think it's probably time to include it into the input tree as it
> > seems functional enough.
>
> Here it is. This includes allow-i8042-register-location-override-2.patch
> from the -mm patchset and the differential patch I sent yesterday.
>
> Attached rather than inline because I haven't figured out how to
> unbreak Kmail-1.7's tab to space conversions.

Thanks, applied.

--
Vojtech Pavlik
SuSE Labs, SuSE CR