summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorVojtech Pavlik <vojtech@kernel.bkbits.net>2003-06-20 14:33:11 -0700
committerVojtech Pavlik <vojtech@kernel.bkbits.net>2003-06-20 14:33:11 -0700
commit040937656bdccbdf20ca9bc5f9f7a07174faaef7 (patch)
tree0727346762ffe7b857ef61175696e93d305ba39b /drivers
parentbde2a39510e3c2ab272619daa0235b2e8b3c0e09 (diff)
input: Fix misdetection of PS2 mice as AT keyboards on non-PC machines
where ATKBD_CMD_RESET_BAT is used.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/keyboard/atkbd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 367587382e23..56a514ae145b 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -89,7 +89,7 @@ static unsigned char atkbd_set3_keycode[512] = {
#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 @@ static int atkbd_command(struct atkbd *atkbd, unsigned char *param, int command)
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 &&
@@ -271,6 +272,9 @@ static int atkbd_command(struct atkbd *atkbd, unsigned char *param, int command)
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;
return -1;