input: i8042: Make sure the keyboard is enabled
authorSimon Glass <sjg@chromium.org>
Sat, 12 Mar 2016 05:06:50 +0000 (22:06 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Thu, 17 Mar 2016 02:27:24 +0000 (10:27 +0800)
Add one more step into the init sequence. This fixes the keyboard on samus,
which otherwise does not work.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
drivers/input/i8042.c
include/i8042.h

index 661d7fd86c44a90f95ee9aba7cd0295852fb2a0e..03d48403857a862c2e6224a15a71eb4472119607 100644 (file)
@@ -134,6 +134,10 @@ static int kbd_reset(int quirk)
            kbd_read(I8042_DATA_REG) != KBD_POR)
                goto err;
 
+       if (kbd_write(I8042_DATA_REG, CMD_DRAIN_OUTPUT) ||
+           kbd_read(I8042_DATA_REG) != KBD_ACK)
+               goto err;
+
        /* set AT translation and disable irq */
        config = kbd_cmd_read(CMD_RD_CONFIG);
        if (config == -1)
index 9723b6a664184fcd2eb714c82d191487223dc25b..0766488acbb3dcde43bd2e52fa7adb98ccebb91a 100644 (file)
@@ -35,6 +35,7 @@
 #define CMD_KBD_DIS    0xad    /* keyboard disable */
 #define CMD_KBD_EN     0xae    /* keyboard enable */
 #define CMD_SET_KBD_LED        0xed    /* set keyboard led */
+#define CMD_DRAIN_OUTPUT 0xf4   /* drain output buffer */
 #define CMD_RESET_KBD  0xff    /* reset keyboard */
 
 /* i8042 command result */