All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: vojtech@suse.cz, kernel list <linux-kernel@vger.kernel.org>
Subject: Map extra keys on compaq evo
Date: Sun, 31 Oct 2004 22:38:59 +0100	[thread overview]
Message-ID: <20041031213859.GA6742@elf.ucw.cz> (raw)

Hi!

Compaq Evo notebooks seem to use non-standard keycodes for their extra
keys. I workaround that quirk with dmi hook.

I think that number of such workarounds neccessary should be
reasonably small (like one for each manufacturer), and therefore this
would be good thing...
								Pavel

--- clean/drivers/input/keyboard/atkbd.c	2004-10-01 00:30:13.000000000 +0200
+++ linux/drivers/input/keyboard/atkbd.c	2004-10-31 22:35:52.000000000 +0100
@@ -26,6 +26,7 @@
 #include <linux/input.h>
 #include <linux/serio.h>
 #include <linux/workqueue.h>
+#include <linux/dmi.h>
 
 #define DRIVER_DESC	"AT and PS/2 keyboard driver"
 
@@ -986,8 +987,31 @@
 	.cleanup	= atkbd_cleanup,
 };
 
+static int __init add_evo_keys(struct dmi_system_id *d)
+{
+	printk("Compaq Evo detected, mapping extra keys\n");
+	atkbd_set2_keycode[0x80 | atkbd_unxlate_table[0x23] ] = 150;
+	atkbd_set2_keycode[0x80 | atkbd_unxlate_table[0x1e] ] = 155;
+	atkbd_set2_keycode[0x80 | atkbd_unxlate_table[0x1a] ] = 217;
+	atkbd_set2_keycode[0x80 | atkbd_unxlate_table[0x1f] ] = 157;
+	return 0;
+}
+
+static struct dmi_system_id __initdata keyboard_dmi_table[] = {
+	{       /* Handle special keys on Compaq Evo */
+		.callback = add_evo_keys,
+		.ident = "Compaq Evo",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Evo N620c"),
+		},
+	}
+};
+
+
 int __init atkbd_init(void)
 {
+	dmi_check_system(keyboard_dmi_table);
 	serio_register_driver(&atkbd_drv);
 	return 0;
 }

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

             reply	other threads:[~2004-10-31 21:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-31 21:38 Pavel Machek [this message]
2004-10-31 22:45 ` Map extra keys on compaq evo Brice Goglin
2004-11-01  1:16 ` Dmitry Torokhov
2004-11-01  8:03   ` Pavel Machek
2004-11-01  9:38     ` Vojtech Pavlik
2004-11-01 13:32       ` Pavel Machek
2004-11-01 14:07         ` Vojtech Pavlik
2004-11-01 17:28           ` Pavel Machek
2004-11-02  4:18             ` Dmitry Torokhov
2004-11-02  9:31               ` Stelian Pop
2004-11-10 17:11               ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041031213859.GA6742@elf.ucw.cz \
    --to=pavel@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.