Commit 04093765 authored by Vojtech Pavlik's avatar Vojtech Pavlik

input: Fix misdetection of PS2 mice as AT keyboards on non-PC machines

       where ATKBD_CMD_RESET_BAT is used.
parent bde2a395
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment