summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2020-11-14 13:43:21 +0100
committerPatrick Georgi <pgeorgi@google.com>2021-04-18 20:45:23 +0000
commit1f2b5fb20137afc897aff6304cd31682cac56282 (patch)
treefab93d959d4f3e355006c4b685aaee8e6be46443
parent4dc92782fca59e797556f6278c247b88f91c09ec (diff)
downloadcoreboot-1f2b5fb20137afc897aff6304cd31682cac56282.tar.xz
libpayload/keyboard: Reset to scancode set #2 on exit
If we select scancode set #1 and keep that, it can confuse Linux with keyboards that don't return to set #2 when asked to load the defaults. This happens for instance with various integrated Think- Pad keyboards but was also seen with an external PS/2 one. The chosen configuration, scancode set #2 without translation, seems to be the default for many systems. So we can expect other payloads and kernels to work with it. Change-Id: I28d74590e9f04d32bb2bbd461b67f15014f927ec Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/47594 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--payloads/libpayload/drivers/i8042/keyboard.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/i8042/keyboard.c b/payloads/libpayload/drivers/i8042/keyboard.c
index cc412ac6e0..a695723a06 100644
--- a/payloads/libpayload/drivers/i8042/keyboard.c
+++ b/payloads/libpayload/drivers/i8042/keyboard.c
@@ -655,6 +655,11 @@ void keyboard_disconnect(void)
keyboard_cmd(I8042_KBCMD_DEFAULT_DIS);
keyboard_drain_input();
+ /* Nobody but us seems to still use scancode set #1.
+ So try to hand over with more modern settings. */
+ set_scancode_set(2);
+ i8042_set_kbd_translation(false);
+
/* Send keyboard disconnect command */
i8042_cmd(I8042_CMD_DIS_KB);