From: Marin Mitov <mitov@issp.bas.bg>
To: linux-kernel@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Vojtech Pavlik <vojtech@suse.cz>
Subject: Regression?: keyboard state/LED inconsistency in 2.6.32-rc1/2,3,4
Date: Mon, 12 Oct 2009 11:18:28 +0300 [thread overview]
Message-ID: <200910121118.29415.mitov@issp.bas.bg> (raw)
Hello,
I'm testing 2.6.32-rc1/2,3,4 and I'm using 2.6.31.3.
There is a difference in keyboard/LED behavior.
If in BIOS NumLock is set on, when the kernel starts
it puts NumLock off and the LED state is off in 2.6.31.3
(which is consistent), but in 2.6.32-rc1/2,3,4 the LED
stays on (and this is not consistent with keyboard's state).
Comparing drivers/input/keyboard/atkbd.c (I'm using it)
in 2.6.31.3 and 2.6.32-rc1/2,3,4 among others changes I
found the following lines (see the patch bellow) deleted,
so I propose either to add them again (this will restore
keyboard/LED consistency) or revert the patch that has
deleted them.
The better solution will be if the kernel preserves the state
of the keyboard as set by BIOS.
Best regards.
Marin Mitov
P.S. The lines in the patch concerning "repeat rate" are
not related with the "keyboard state/LED inconsistency",
but have been also deleted (by mistake/intentionally) too.
Could be dropped if necessary.
Marin Mitov
Signed-off-by: Marin Mitov <mitov@issp.bas.bg>
======================================================
--- a/drivers/input/keyboard/atkbd.c 2009-10-11 20:15:27.000000000 +0300
+++ b/drivers/input/keyboard/atkbd.c 2009-10-11 20:17:34.000000000 +0300
@@ -773,6 +773,23 @@
static int atkbd_activate(struct atkbd *atkbd)
{
struct ps2dev *ps2dev = &atkbd->ps2dev;
+ unsigned char param[1];
+
+/*
+ * Set the LEDs to a defined state.
+ */
+
+ param[0] = 0;
+ if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS))
+ return -1;
+
+/*
+ * Set autorepeat to fastest possible.
+ */
+
+ param[0] = 0;
+ if (ps2_command(ps2dev, param, ATKBD_CMD_SETREP))
+ return -1;
/*
* Enable the keyboard to receive keystrokes.
@@ -1141,6 +1158,14 @@
return -1;
atkbd_activate(atkbd);
+
+/*
+ * Restore repeat rate and LEDs (that were reset by atkbd_activate)
+ * to pre-resume state
+ */
+ if (!atkbd->softrepeat)
+ atkbd_set_repeat_rate(atkbd);
+ atkbd_set_leds(atkbd);
}
atkbd_enable(atkbd);
next reply other threads:[~2009-10-12 8:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-12 8:18 Marin Mitov [this message]
2009-10-12 8:30 ` Regression?: keyboard state/LED inconsistency in 2.6.32-rc1/2,3,4 Vojtech Pavlik
2009-10-12 8:57 ` Dmitry Torokhov
2009-10-13 3:03 ` Dmitry Torokhov
2009-10-13 4:55 ` Marin Mitov
2009-10-13 5:17 ` Dmitry Torokhov
2009-10-13 5:19 ` Dmitry Torokhov
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=200910121118.29415.mitov@issp.bas.bg \
--to=mitov@issp.bas.bg \
--cc=dmitry.torokhov@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox