diff mbox

[U-Boot,v2,05/51] input: i8042: Make sure the keyboard is enabled

Message ID 1457759256-23432-6-git-send-email-sjg@chromium.org
State Accepted
Commit 8226a3e99f1c1e7ded648721d1e16118453761e5
Delegated to: Bin Meng
Headers show

Commit Message

Simon Glass March 12, 2016, 5:06 a.m. UTC
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>
---

Changes in v2:
- Use a #define for the output flush command
- Adjust the code order slightly

 drivers/input/i8042.c | 4 ++++
 include/i8042.h       | 1 +
 2 files changed, 5 insertions(+)

Comments

Bin Meng March 14, 2016, 4:17 a.m. UTC | #1
On Sat, Mar 12, 2016 at 1:06 PM, Simon Glass <sjg@chromium.org> wrote:
> 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>
> ---
>
> Changes in v2:
> - Use a #define for the output flush command
> - Adjust the code order slightly
>
>  drivers/input/i8042.c | 4 ++++
>  include/i8042.h       | 1 +
>  2 files changed, 5 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Tested on QEMU and Crown Bay
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Bin Meng March 14, 2016, 4:25 a.m. UTC | #2
On Mon, Mar 14, 2016 at 12:17 PM, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Sat, Mar 12, 2016 at 1:06 PM, Simon Glass <sjg@chromium.org> wrote:
>> 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>
>> ---
>>
>> Changes in v2:
>> - Use a #define for the output flush command
>> - Adjust the code order slightly
>>
>>  drivers/input/i8042.c | 4 ++++
>>  include/i8042.h       | 1 +
>>  2 files changed, 5 insertions(+)
>>
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>
> Tested on QEMU and Crown Bay
> Tested-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86/next, thanks!
diff mbox

Patch

diff --git a/drivers/input/i8042.c b/drivers/input/i8042.c
index 661d7fd..03d4840 100644
--- a/drivers/input/i8042.c
+++ b/drivers/input/i8042.c
@@ -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)
diff --git a/include/i8042.h b/include/i8042.h
index 9723b6a..0766488 100644
--- a/include/i8042.h
+++ b/include/i8042.h
@@ -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 */