summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
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;