[PATCH 2/11] input: Fix misdetection of PS/2 mice as AT keyboards

Vojtech Pavlik (vojtech@ucw.cz)
Sat, 21 Jun 2003 15:51:57 +0200


You can pull this changeset from:
bk://kernel.bkbits.net/vojtech/input

===================================================================

ChangeSet@1.1360, 2003-06-21 04:33:11-07:00, vojtech@kernel.bkbits.net
input: Fix misdetection of PS2 mice as AT keyboards on non-PC machines
where ATKBD_CMD_RESET_BAT is used.

atkbd.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

===================================================================

diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c Sat Jun 21 15:24:59 2003
+++ b/drivers/input/keyboard/atkbd.c Sat Jun 21 15:24:59 2003
@@ -89,7 +89,7 @@
#define ATKBD_CMD_GETID 0x02f2
#define ATKBD_CMD_ENABLE 0x00f4
#define ATKBD_CMD_RESET_DIS 0x00f5
-#define ATKBD_CMD_RESET_BAT 0x01ff
+#define ATKBD_CMD_RESET_BAT 0x02ff
#define ATKBD_CMD_SETALL_MB 0x00f8
#define ATKBD_CMD_RESEND 0x00fe
#define ATKBD_CMD_EX_ENABLE 0x10ea
@@ -255,7 +255,8 @@

while (atkbd->cmdcnt && timeout--) {

- if (atkbd->cmdcnt == 1 && command == ATKBD_CMD_RESET_BAT)
+ if (atkbd->cmdcnt == 1 &&
+ command == ATKBD_CMD_RESET_BAT && timeout > 100000)
timeout = 100000;

if (atkbd->cmdcnt == 1 && command == ATKBD_CMD_GETID &&
@@ -270,6 +271,9 @@
if (param)
for (i = 0; i < receive; i++)
param[i] = atkbd->cmdbuf[(receive - 1) - i];
+
+ if (command == ATKBD_CMD_RESET_BAT && atkbd->cmdcnt == 1)
+ atkbd->cmdcnt = 0;

if (atkbd->cmdcnt) {
atkbd->cmdcnt = 0;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/