From a082274af650d95bfc2d016b643d128e15b8cead Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Tue, 16 May 2017 07:39:10 -0700 Subject: [PATCH] eve: Enable mutable scancode for EVT boards Enable the mutable scancode sets for EVT boards and reassign the existing F13 scancode to instead send the new 0[e0 58] 1[e0 07] scancode instead. BUG=b:36735408 BRANCH=none TEST=manual testing on Eve EVT to ensure that the key that used to send F13 now sends the new scancode. Also test on P1 to ensure that the key still sends F13. Change-Id: Ia134db7b069d5bf10c931ee7ce66dd1ea85d3544 Signed-off-by: Duncan Laurie Reviewed-on: https://chromium-review.googlesource.com/506718 Reviewed-by: Aseda Aboagye Reviewed-by: Furquan Shaikh --- board/eve/board.c | 10 ++++++++++ board/eve/board.h | 1 + 2 files changed, 11 insertions(+) diff --git a/board/eve/board.c b/board/eve/board.c index b3299cb8d0..d9f99fa7aa 100644 --- a/board/eve/board.c +++ b/board/eve/board.c @@ -30,6 +30,7 @@ #include "host_command.h" #include "i2c.h" #include "keyboard_scan.h" +#include "keyboard_8042_sharedlib.h" #include "lid_angle.h" #include "lid_switch.h" #include "math_util.h" @@ -385,6 +386,15 @@ static void board_init(void) /* Provide AC status to the PCH */ gpio_set_level(GPIO_PCH_ACOK, extpower_is_present()); + +#if defined(CONFIG_KEYBOARD_SCANCODE_MUTABLE) && !defined(TEST_BUILD) + if (board_get_version() == 4) { + /* Set F13 to new defined key on EVT */ + CPRINTS("Overriding F13 scan code"); + scancode_set1[3][9] = 0xe058; + scancode_set2[3][9] = 0xe007; + } +#endif } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); diff --git a/board/eve/board.h b/board/eve/board.h index 236e1f2601..a018e9f96c 100644 --- a/board/eve/board.h +++ b/board/eve/board.h @@ -72,6 +72,7 @@ #define CONFIG_KEYBOARD_BOARD_CONFIG #define CONFIG_KEYBOARD_COL2_INVERTED #define CONFIG_KEYBOARD_PROTOCOL_8042 +#define CONFIG_KEYBOARD_SCANCODE_MUTABLE #define CONFIG_TABLET_MODE /* Battery */