From: Vojtech Pavlik <vojtech-AlSwsSmVLrQ@public.gmane.org>
To: "P. Christeas" <p_christ-U04EIuiosng@public.gmane.org>
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
lkml <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: FYI: ACPI 'sleep 1' resets atkbd keycodes
Date: Sun, 25 Jan 2004 12:59:46 +0100 [thread overview]
Message-ID: <20040125115946.GA414@ucw.cz> (raw)
In-Reply-To: <200401251137.21646.p_christ-U04EIuiosng@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 763 bytes --]
On Sun, Jan 25, 2004 at 11:37:19AM +0200, P. Christeas wrote:
> This may be just a minor issue:
> I had to use the setkeycodes utility to enable some extra keys (that weren't
> mapped by kernel's atkbd tables).
> After waking from sleep 1, those keys were reset. That is, I had to use
> 'setkeycodes' again to customize the tables again.
>
> IMHO the way kernel works now is correct. It should *not* have extra code just
> to handle that. Just make sure anybody that alters his kbd tables puts some
> extra script to recover the tables after an ACPI wake.
> This should be more like a note to Linux distributors.
>
> Have a nice day.
Patch attached, please test. It'll make it into 2.6.3, with some luck
even 2.6.2.
--
Vojtech Pavlik
SuSE Labs, SuSE CR
[-- Attachment #2: atkbd-noreinit --]
[-- Type: text/plain, Size: 2031 bytes --]
ChangeSet-SdAw1wE8/5A@public.gmane.org, 2004-01-25 12:58:24+01:00, vojtech@ucw.cz
input: Bail out in atkbd.c if scancode set is changed, don't
reinitialize scancode map. This is even more anoying than
a new keyboard device in the unlikely case of set change.
atkbd.c | 37 ++++++-------------------------------
1 files changed, 6 insertions(+), 31 deletions(-)
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c Sun Jan 25 12:59:07 2004
+++ b/drivers/input/keyboard/atkbd.c Sun Jan 25 12:59:07 2004
@@ -743,43 +743,18 @@
struct serio_dev *dev = serio->dev;
int i;
- if (!dev) {
- printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n");
- return -1;
- }
+ if (!dev) {
+ printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n");
+ return -1;
+ }
if (atkbd->write) {
if (atkbd_probe(atkbd))
return -1;
-
- atkbd->set = atkbd_set_3(atkbd);
+ if (atkbd->set != atkbd_set_3(atkbd))
+ return -1;
atkbd_enable(atkbd);
- } else {
- atkbd->set = 2;
- atkbd->id = 0xab00;
}
-
- /*
- * Here we probably should check if the keyboard has the same set that
- * it had before and bail out if it's different. But this will most likely
- * cause new keyboard device be created... and for the user it will look
- * like keyboard is lost
- */
-
- if (atkbd->translated) {
- for (i = 0; i < 128; i++) {
- atkbd->keycode[i] = atkbd_set2_keycode[atkbd_unxlate_table[i]];
- atkbd->keycode[i | 0x80] = atkbd_set2_keycode[atkbd_unxlate_table[i] | 0x80];
- }
- } else if (atkbd->set == 2) {
- memcpy(atkbd->keycode, atkbd_set2_keycode, sizeof(atkbd->keycode));
- } else {
- memcpy(atkbd->keycode, atkbd_set3_keycode, sizeof(atkbd->keycode));
- }
-
- for (i = 0; i < 512; i++)
- if (atkbd->keycode[i] && atkbd->keycode[i] < 255)
- set_bit(atkbd->keycode[i], atkbd->dev.keybit);
return 0;
}
WARNING: multiple messages have this Message-ID (diff)
From: Vojtech Pavlik <vojtech@suse.cz>
To: "P. Christeas" <p_christ@hol.gr>
Cc: acpi-devel@lists.sourceforge.net, lkml <linux-kernel@vger.kernel.org>
Subject: Re: FYI: ACPI 'sleep 1' resets atkbd keycodes
Date: Sun, 25 Jan 2004 12:59:46 +0100 [thread overview]
Message-ID: <20040125115946.GA414@ucw.cz> (raw)
In-Reply-To: <200401251137.21646.p_christ@hol.gr>
[-- Attachment #1: Type: text/plain, Size: 763 bytes --]
On Sun, Jan 25, 2004 at 11:37:19AM +0200, P. Christeas wrote:
> This may be just a minor issue:
> I had to use the setkeycodes utility to enable some extra keys (that weren't
> mapped by kernel's atkbd tables).
> After waking from sleep 1, those keys were reset. That is, I had to use
> 'setkeycodes' again to customize the tables again.
>
> IMHO the way kernel works now is correct. It should *not* have extra code just
> to handle that. Just make sure anybody that alters his kbd tables puts some
> extra script to recover the tables after an ACPI wake.
> This should be more like a note to Linux distributors.
>
> Have a nice day.
Patch attached, please test. It'll make it into 2.6.3, with some luck
even 2.6.2.
--
Vojtech Pavlik
SuSE Labs, SuSE CR
[-- Attachment #2: atkbd-noreinit --]
[-- Type: text/plain, Size: 2009 bytes --]
ChangeSet@1.1519, 2004-01-25 12:58:24+01:00, vojtech@ucw.cz
input: Bail out in atkbd.c if scancode set is changed, don't
reinitialize scancode map. This is even more anoying than
a new keyboard device in the unlikely case of set change.
atkbd.c | 37 ++++++-------------------------------
1 files changed, 6 insertions(+), 31 deletions(-)
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c Sun Jan 25 12:59:07 2004
+++ b/drivers/input/keyboard/atkbd.c Sun Jan 25 12:59:07 2004
@@ -743,43 +743,18 @@
struct serio_dev *dev = serio->dev;
int i;
- if (!dev) {
- printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n");
- return -1;
- }
+ if (!dev) {
+ printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n");
+ return -1;
+ }
if (atkbd->write) {
if (atkbd_probe(atkbd))
return -1;
-
- atkbd->set = atkbd_set_3(atkbd);
+ if (atkbd->set != atkbd_set_3(atkbd))
+ return -1;
atkbd_enable(atkbd);
- } else {
- atkbd->set = 2;
- atkbd->id = 0xab00;
}
-
- /*
- * Here we probably should check if the keyboard has the same set that
- * it had before and bail out if it's different. But this will most likely
- * cause new keyboard device be created... and for the user it will look
- * like keyboard is lost
- */
-
- if (atkbd->translated) {
- for (i = 0; i < 128; i++) {
- atkbd->keycode[i] = atkbd_set2_keycode[atkbd_unxlate_table[i]];
- atkbd->keycode[i | 0x80] = atkbd_set2_keycode[atkbd_unxlate_table[i] | 0x80];
- }
- } else if (atkbd->set == 2) {
- memcpy(atkbd->keycode, atkbd_set2_keycode, sizeof(atkbd->keycode));
- } else {
- memcpy(atkbd->keycode, atkbd_set3_keycode, sizeof(atkbd->keycode));
- }
-
- for (i = 0; i < 512; i++)
- if (atkbd->keycode[i] && atkbd->keycode[i] < 255)
- set_bit(atkbd->keycode[i], atkbd->dev.keybit);
return 0;
}
next prev parent reply other threads:[~2004-01-25 11:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-25 9:37 FYI: ACPI 'sleep 1' resets atkbd keycodes P. Christeas
2004-01-25 9:37 ` P. Christeas
[not found] ` <200401251137.21646.p_christ-U04EIuiosng@public.gmane.org>
2004-01-25 10:50 ` Vojtech Pavlik
2004-01-25 10:50 ` Vojtech Pavlik
2004-01-25 11:59 ` Vojtech Pavlik [this message]
2004-01-25 11:59 ` Vojtech Pavlik
2004-01-26 17:42 ` P. Christeas
2004-02-03 4:38 ` Dmitry Torokhov
[not found] ` <200402022338.48010.dtor_core-yWtbtysYrB+LZ21kGMrzwg@public.gmane.org>
2004-02-03 7:37 ` Vojtech Pavlik
2004-02-03 7:37 ` Vojtech Pavlik
2004-01-26 23:41 ` bill davidsen
-- strict thread matches above, loose matches on Subject: below --
2004-02-03 6:27 Yu, Luming
2004-02-03 6:27 ` Yu, Luming
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=20040125115946.GA414@ucw.cz \
--to=vojtech-alswssmvlrq@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=p_christ-U04EIuiosng@public.gmane.org \
/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.