summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo-Tsai <leocx_tsai@compal.corp-partner.google.com>2020-07-24 10:57:44 +0800
committerCommit Bot <commit-bot@chromium.org>2020-09-18 11:35:49 +0000
commitd0e12f25cd35c5812da41180ef17aed69fca3871 (patch)
tree4bb1480277462b338cea621dbf55c3de6722cdb9
parentf608eba27f67f253661be0cf01eb28889cee2b60 (diff)
downloadchrome-ec-d0e12f25cd35c5812da41180ef17aed69fca3871.tar.gz
madoo: Support UK2 keyboard
This patch swaps the forwardslash-pipe key (scancode=0x56) with the right control key (scancode=0xe014) if UK2 bit in fw_config is define. BUG=b:162016093 BRANCH=none TEST=make BOARD=madoo Signed-off-by: Leo-Tsai <leocx_tsai@compal.corp-partner.google.com> Change-Id: I07be81b3ac3cafab46ac07a67f018e87166e375a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2315970 Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Henry Sun <henrysun@google.com>
-rw-r--r--board/madoo/board.c12
-rw-r--r--board/madoo/board.h6
2 files changed, 18 insertions, 0 deletions
diff --git a/board/madoo/board.c b/board/madoo/board.c
index a181908d83..fe83a89d96 100644
--- a/board/madoo/board.c
+++ b/board/madoo/board.c
@@ -29,6 +29,7 @@
#include "hooks.h"
#include "i2c.h"
#include "keyboard_scan.h"
+#include "keyboard_8042_sharedlib.h"
#include "lid_switch.h"
#include "motion_sense.h"
#include "power.h"
@@ -129,6 +130,17 @@ void board_init(void)
/* Turn on 5V if the system is on, otherwise turn it off. */
on = chipset_in_state(CHIPSET_STATE_ON | CHIPSET_STATE_ANY_SUSPEND);
board_power_5v_enable(on);
+ if (get_cbi_fw_config_keyboard() == CUST_UK2_KB) {
+ /*
+ * Observed on Shyvana with UK keyboard,
+ * \|: 0x0061->0x61->0x56
+ * r-ctrl: 0xe014->0x14->0x1d
+ */
+ uint16_t tmp = get_scancode_set2(4, 0);
+
+ set_scancode_set2(4, 0, get_scancode_set2(2, 7));
+ set_scancode_set2(2, 7, tmp);
+ }
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
diff --git a/board/madoo/board.h b/board/madoo/board.h
index 3d99e59627..03e1aca20c 100644
--- a/board/madoo/board.h
+++ b/board/madoo/board.h
@@ -149,6 +149,12 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
+/* Keyboard type */
+enum fw_config_keyboard_type {
+ COMMON_KB = 0,
+ CUST_UK2_KB = 1,
+};
+
int board_is_sourcing_vbus(int port);
#endif /* !__ASSEMBLER__ */