Skip to contentSkip to conversation

input: Add some extra PNP keyboard types

PATCH In review Matthew Garrett 3 participants 6 messages May 17, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 input: Add some extra PNP keyboard types

Some Japanese machines declare their keyboard with a different PNP ID. Add it to the list of probed device IDs. While we're at it, add all the other IDs that Windows binds to - we'll probably never see them in the real world, but it doesn't hurt.

---
 drivers/input/serio/i8042-x86ia64io.h |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
drivers/input/serio/i8042-x86ia64io.h +13 -0
index ead0494..871a74c 100644
@@ -660,8 +660,21 @@ static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *
 }
 
 static struct pnp_device_id pnp_kbd_devids[] = {
+	{ .id = "PNP0300", .driver_data = 0 },
+	{ .id = "PNP0301", .driver_data = 0 },
+	{ .id = "PNP0302", .driver_data = 0 },
 	{ .id = "PNP0303", .driver_data = 0 },
+	{ .id = "PNP0304", .driver_data = 0 },
+	{ .id = "PNP0305", .driver_data = 0 },
+	{ .id = "PNP0306", .driver_data = 0 },
+	{ .id = "PNP0309", .driver_data = 0 },
+	{ .id = "PNP030a", .driver_data = 0 },
 	{ .id = "PNP030b", .driver_data = 0 },
+	{ .id = "PNP0320", .driver_data = 0 },
+	{ .id = "PNP0343", .driver_data = 0 },
+	{ .id = "PNP0344", .driver_data = 0 },
+	{ .id = "PNP0345", .driver_data = 0 },
+	{ .id = "CPQA0D7", .driver_data = 0 },
 	{ .id = "", },
 };
 
Signature · 1 line
1.7.0.1
#1 lore raw

PATCH v2 2/3 input: Add a PNP entry to the aux device list

Windows checks for an ALPS PS/2 device in PNP. Add it on the off-chance that there's a machine that expresses this without also providing a compatibility ID.

---
 drivers/input/serio/i8042-x86ia64io.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/input/serio/i8042-x86ia64io.h +1 -0
index 871a74c..6168469 100644
@@ -685,6 +685,7 @@ static struct pnp_driver i8042_pnp_kbd_driver = {
 };
 
 static struct pnp_device_id pnp_aux_devids[] = {
+	{ .id = "AUI0200", .driver_data = 0 },
 	{ .id = "FJC6000", .driver_data = 0 },
 	{ .id = "FJC6001", .driver_data = 0 },
 	{ .id = "PNP0f03", .driver_data = 0 },
Signature · 1 line
1.7.0.1
#2 lore raw

PATCH v2 3/3 input: Default to only using PNP for i8042 probing on x86

In reply to Matthew Garrett

Experimenting with Windows has revealed that it will not probe the keyboard controller unless a valid PNPACPI device is present. Change our behaviour to match - users can override by using the existing i8042.nopnp=1 parameter.

---
 drivers/input/serio/i8042-x86ia64io.h |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/input/serio/i8042-x86ia64io.h +6 -3
index 6168469..a5b5926 100644
@@ -1,6 +1,8 @@
 #ifndef _I8042_X86IA64IO_H
 #define _I8042_X86IA64IO_H
 
+#include <linux/acpi.h>
+
 /*
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published by
@@ -744,9 +746,10 @@ static int __init i8042_pnp_init(void)
 
 	if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
 		i8042_pnp_exit();
-#if defined(__ia64__)
-		return -ENODEV;
-#else
+
+		if (!acpi_disabled)
+			return -ENODEV;
+
 		printk(KERN_INFO "PNP: No PS/2 controller found. Probing ports directly.\n");
 		return 0;
 #endif
Signature · 1 line
1.7.0.1
#3 lore raw

Re: [PATCH V2 3/3] input: Default to only using PNP for i8042 probing on x86

Quoted 4 lines · Matthew Garrett
drivers/input/serio/i8042-x86ia64io.h +0 -0
@@ -744,9 +746,10 @@ static int __init i8042_pnp_init(void)
 
 	if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
 		i8042_pnp_exit();

drivers/input/serio/i8042-x86ia64io.h static int __init i8042_pnp_init(void) · line 755

Quoted 10 lines
drivers/input/serio/i8042-x86ia64io.h +4 -3
-#if defined(__ia64__)
-		return -ENODEV;
-#else
+
+		if (!acpi_disabled)
+			return -ENODEV;
+
 		printk(KERN_INFO "PNP: No PS/2 controller found. Probing ports directly.\n");
 		return 0;
 #endif

This can't be right. That #endif is still there. How could this even compile?

Tssk, tssk.

Linus

#4 lore raw

Re: [PATCH V2 3/3] input: Default to only using PNP for i8042 probing on x86

Quoted 4 lines · Linus Torvalds

This can't be right. That #endif is still there. How could this even compile?

Tssk, tssk.

Crap. Sorry, I suck. I'll resend this one.

Signature · 1 line
Matthew Garrett | [email protected]
#5 lore raw

PATCH v3 1/1 input: Default to only using PNP for i8042 probing on x86

In reply to Linus Torvalds

Experimenting with Windows has revealed that it will not probe the keyboard controller unless a valid PNPACPI device is present. Change our behaviour to match - users can override by using the existing i8042.nopnp=1 parameter.

---
 drivers/input/serio/i8042-x86ia64io.h |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
drivers/input/serio/i8042-x86ia64io.h +10 -4
index 6168469..19d11f3 100644
@@ -1,6 +1,8 @@
 #ifndef _I8042_X86IA64IO_H
 #define _I8042_X86IA64IO_H
 
+#include <linux/acpi.h>
+
 /*
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published by
@@ -744,12 +746,16 @@ static int __init i8042_pnp_init(void)
 
 	if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
 		i8042_pnp_exit();
-#if defined(__ia64__)
-		return -ENODEV;
-#else
+
+		/* Non-ACPI systems are much less likely to have the
+		 * KBC declared via PNP, so if acpi is disabled fall
+		 * back to banging the ports directly */
+
+		if (!acpi_disabled)
+			return -ENODEV;
+
 		printk(KERN_INFO "PNP: No PS/2 controller found. Probing ports directly.\n");
 		return 0;
-#endif
 	}
 
 	if (i8042_pnp_kbd_devices)
Signature · 1 line
1.7.0.1