summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommy Chung <tommy.chung@quanta.corp-partner.google.com>2023-04-27 20:50:36 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-08 09:22:43 +0000
commite9b1ee0e784aad16a65eeb370bcaf49d585c6666 (patch)
treed9193ce0138b7abb4bd8eb281276924468b34ef2
parent16d788c61bd3ee6899ea25a48a7f7cfbc7bcdb36 (diff)
downloadchrome-ec-e9b1ee0e784aad16a65eeb370bcaf49d585c6666.tar.gz
yavilla: Update keyboard config
Update keyboard config for yavilla, including vivaldi type, no numeric pad and 24 pins in total at connector. BUG=b:279353236 TEST=make sure all top row function keys work correctly and keyboard factory test works. Change-Id: Ia4a9d683162fcb472b3704db8f67d2315011a49b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4482505 Reviewed-by: Devin Lu <devin.lu@quantatw.com> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Commit-Queue: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
-rw-r--r--zephyr/program/nissa/yavilla/src/keyboard.c72
1 files changed, 25 insertions, 47 deletions
diff --git a/zephyr/program/nissa/yavilla/src/keyboard.c b/zephyr/program/nissa/yavilla/src/keyboard.c
index 93db22132f..d942405faa 100644
--- a/zephyr/program/nissa/yavilla/src/keyboard.c
+++ b/zephyr/program/nissa/yavilla/src/keyboard.c
@@ -1,4 +1,4 @@
-/* Copyright 2022 The ChromiumOS Authors
+/* Copyright 2023 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -14,24 +14,8 @@
LOG_MODULE_DECLARE(nissa, CONFIG_NISSA_LOG_LEVEL);
-/* Keyboard scan setting */
-__override struct keyboard_scan_config keyscan_config = {
- /* Increase from 50 us, because KSO_02 passes through the H1. */
- .output_settle_us = 80,
- /* Other values should be the same as the default configuration. */
- .debounce_down_us = 9 * MSEC,
- .debounce_up_us = 30 * MSEC,
- .scan_period_us = 3 * MSEC,
- .min_post_scan_delay_us = 1000,
- .poll_timeout_us = 100 * MSEC,
- .actual_key_mask = {
- 0x1c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xa4, 0xff, 0xf6, 0x55, 0xfe, 0xff, 0xff, 0xff, /* full set */
- },
-};
-
-static const struct ec_response_keybd_config yavilla_kb_w_kb_light = {
- .num_top_row_keys = 13,
+static const struct ec_response_keybd_config kb_tablet_present = {
+ .num_top_row_keys = 10,
.action_keys = {
TK_BACK, /* T1 */
TK_REFRESH, /* T2 */
@@ -40,18 +24,16 @@ static const struct ec_response_keybd_config yavilla_kb_w_kb_light = {
TK_SNAPSHOT, /* T5 */
TK_BRIGHTNESS_DOWN, /* T6 */
TK_BRIGHTNESS_UP, /* T7 */
- TK_KBD_BKLIGHT_TOGGLE, /* T8 */
- TK_PLAY_PAUSE, /* T9 */
- TK_MICMUTE, /* T10 */
- TK_VOL_MUTE, /* T11 */
- TK_VOL_DOWN, /* T12 */
- TK_VOL_UP, /* T13 */
+ TK_VOL_MUTE, /* T8 */
+ TK_VOL_DOWN, /* T9 */
+ TK_VOL_UP, /* T10 */
},
- .capabilities = KEYBD_CAP_NUMERIC_KEYPAD,
+ .capabilities = KEYBD_CAP_SCRNLOCK_KEY,
+ /* No function keys, no numeric keypad */
};
-static const struct ec_response_keybd_config yavilla_kb_wo_kb_light = {
- .num_top_row_keys = 13,
+static const struct ec_response_keybd_config kb_tablet_absent = {
+ .num_top_row_keys = 10,
.action_keys = {
TK_BACK, /* T1 */
TK_REFRESH, /* T2 */
@@ -60,14 +42,11 @@ static const struct ec_response_keybd_config yavilla_kb_wo_kb_light = {
TK_SNAPSHOT, /* T5 */
TK_BRIGHTNESS_DOWN, /* T6 */
TK_BRIGHTNESS_UP, /* T7 */
- TK_PLAY_PAUSE, /* T8 */
- TK_MICMUTE, /* T9 */
- TK_VOL_MUTE, /* T10 */
- TK_VOL_DOWN, /* T11 */
- TK_VOL_UP, /* T12 */
- TK_MENU, /* T13 */
+ TK_VOL_MUTE, /* T8 */
+ TK_VOL_DOWN, /* T9 */
+ TK_VOL_UP, /* T10 */
},
- .capabilities = KEYBD_CAP_NUMERIC_KEYPAD,
+ /* No function keys, no numeric keypad and no screenlock key */
};
__override const struct ec_response_keybd_config *
@@ -75,12 +54,12 @@ board_vivaldi_keybd_config(void)
{
uint32_t val;
- cros_cbi_get_fw_config(FW_KB_BACKLIGHT, &val);
+ cros_cbi_get_fw_config(FW_TABLET, &val);
- if (val == FW_KB_BACKLIGHT_OFF)
- return &yavilla_kb_wo_kb_light;
+ if (val == FW_TABLET_PRESENT)
+ return &kb_tablet_present;
else
- return &yavilla_kb_w_kb_light;
+ return &kb_tablet_absent;
}
/*
@@ -109,17 +88,16 @@ DECLARE_HOOK(HOOK_INIT, kb_layout_init, HOOK_PRIO_POST_FIRST);
/*
* Map keyboard connector pins to EC GPIO pins for factory test.
* Pins mapped to {-1, -1} are skipped.
- * The connector has 30 pins total, and there is no pin 0.
+ * The connector has 24 pins total, and there is no pin 0.
*/
const int keyboard_factory_scan_pins[][2] = {
{ -1, -1 }, { GPIO_KSOH, 4 }, { GPIO_KSOH, 0 }, { GPIO_KSOH, 1 },
- { GPIO_KSOH, 3 }, { GPIO_KSOH, 2 }, { -1, -1 }, { -1, -1 },
- { GPIO_KSOL, 5 }, { GPIO_KSOL, 6 }, { -1, -1 }, { GPIO_KSOL, 3 },
- { GPIO_KSOL, 2 }, { GPIO_KSI, 0 }, { GPIO_KSOL, 1 }, { GPIO_KSOL, 4 },
- { GPIO_KSI, 3 }, { GPIO_KSI, 2 }, { GPIO_KSOL, 0 }, { GPIO_KSI, 5 },
- { GPIO_KSI, 4 }, { GPIO_KSOL, 7 }, { GPIO_KSI, 6 }, { GPIO_KSI, 7 },
- { GPIO_KSI, 1 }, { -1, -1 }, { GPIO_KSOH, 5 }, { -1, -1 },
- { GPIO_KSOH, 6 }, { -1, -1 }, { -1, -1 },
+ { GPIO_KSOH, 3 }, { GPIO_KSOH, 2 }, { GPIO_KSOL, 5 }, { GPIO_KSOL, 6 },
+ { GPIO_KSOL, 3 }, { GPIO_KSOL, 2 }, { GPIO_KSI, 0 }, { GPIO_KSOL, 1 },
+ { GPIO_KSOL, 4 }, { GPIO_KSI, 3 }, { GPIO_KSI, 2 }, { GPIO_KSOL, 0 },
+ { GPIO_KSI, 5 }, { GPIO_KSI, 4 }, { GPIO_KSOL, 7 }, { GPIO_KSI, 6 },
+ { GPIO_KSI, 7 }, { GPIO_KSI, 1 }, { -1, -1 }, { -1, -1 },
+ { -1, -1 },
};
const int keyboard_factory_scan_pins_used =
ARRAY_SIZE(keyboard_factory_scan_pins);