summaryrefslogtreecommitdiff
path: root/zephyr/emul
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2022-08-01 18:08:49 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-15 15:29:22 +0000
commitfd305e6809233a662c31dae8ca2953271830c958 (patch)
tree48eaab72b24e907c4a3cc53abc2a5a3b4eee70ff /zephyr/emul
parent2e23b2e8bf935cf5000d6016c99a5300c7e53c2c (diff)
downloadchrome-ec-fd305e6809233a662c31dae8ca2953271830c958.tar.gz
keyboard_scan: skip ghost key detection at boot
This CL fixed a bug that EC can't detect the boot key correctly if GSC asserts KSI2/3. When all columns have row2 or 3 asserted, read_matrix() tries to "fix" this by adding more keys to the state array. This causes the check_boot_key() function rejects the adjusted state. To fix this, add another workaround step before the ghost key detection to remove the rows affected by GSC. BUG=b:239674288,b:236580049 TEST=with gsc firmware from b/239674288$comment9, verify tentacruel able to enter recovery mode BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I3df2e56e0537446954e2b5de24bf849c2189d211 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3795747 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'zephyr/emul')
-rw-r--r--zephyr/emul/emul_kb_raw.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/zephyr/emul/emul_kb_raw.c b/zephyr/emul/emul_kb_raw.c
index 1f999f807e..6db8fe63cc 100644
--- a/zephyr/emul/emul_kb_raw.c
+++ b/zephyr/emul/emul_kb_raw.c
@@ -97,6 +97,16 @@ int emul_kb_raw_set_kbstate(const struct device *dev, uint8_t row, uint8_t col,
return 0;
}
+void emul_kb_raw_reset(const struct device *dev)
+{
+ const struct kb_raw_emul_cfg *cfg = dev->config;
+ struct kb_raw_emul_data *data = dev->data;
+
+ for (int col = 0; col < cfg->cols; col++) {
+ data->matrix[col] = 0;
+ }
+}
+
static const struct cros_kb_raw_driver_api emul_kb_raw_driver_api = {
.init = emul_kb_raw_init,
.drive_colum = emul_kb_raw_drive_column,