summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2019-10-04 14:26:35 -0600
committerKeith Short <keithshort@chromium.org>2019-10-11 20:54:53 +0000
commit3c569a2ef2f6458080248938198b05e19e96d2d4 (patch)
tree68d03fd9bcfcfa9abd460823575350613a80a16c
parentecc3027cdf35ecc7072c3ba3804ccd58032c2929 (diff)
downloadchrome-ec-3c569a2ef2f6458080248938198b05e19e96d2d4.tar.gz
volteer: Support keyboard
Configure keyboard features, enable keyboard-related tasks, and define a custom time period to wait for output to settle during key scan. BUG=b:139554320 TEST=make buildall BRANCH=none Change-Id: I0d28389361c87a868f62325b86b65fc5b2550a70 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1841885 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--baseboard/volteer/baseboard.c18
-rw-r--r--baseboard/volteer/baseboard.h6
-rw-r--r--board/volteer/ec.tasklist4
3 files changed, 27 insertions, 1 deletions
diff --git a/baseboard/volteer/baseboard.c b/baseboard/volteer/baseboard.c
index be0370074f..7a2eb207dc 100644
--- a/baseboard/volteer/baseboard.c
+++ b/baseboard/volteer/baseboard.c
@@ -9,6 +9,7 @@
#include "charge_state.h"
#include "gpio.h"
#include "i2c.h"
+#include "keyboard_scan.h"
#include "pwm.h"
#include "pwm_chip.h"
@@ -23,6 +24,23 @@ const enum gpio_signal hibernate_wake_pins[] = {
const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins);
/******************************************************************************/
+/* Keyboard scan setting */
+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 = {
+ 0x14, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff,
+ 0xa4, 0xff, 0xfe, 0x55, 0xfa, 0xca /* full set */
+ },
+};
+
+/******************************************************************************/
/* I2C port map configuration */
const struct i2c_port_t i2c_ports[] = {
{
diff --git a/baseboard/volteer/baseboard.h b/baseboard/volteer/baseboard.h
index e2ebea1c21..6ff7421ec1 100644
--- a/baseboard/volteer/baseboard.h
+++ b/baseboard/volteer/baseboard.h
@@ -53,6 +53,12 @@
#define CONFIG_BOARD_HAS_RTC_RESET
/* Common Keyboard Defines */
+#define CONFIG_CMD_KEYBOARD
+#define CONFIG_KEYBOARD_BOARD_CONFIG
+#define CONFIG_KEYBOARD_COL2_INVERTED
+#define CONFIG_KEYBOARD_KEYPAD
+#define CONFIG_KEYBOARD_PROTOCOL_8042
+#define CONFIG_KEYBOARD_PWRBTN_ASSERTS_KSI2
/* Sensors */
diff --git a/board/volteer/ec.tasklist b/board/volteer/ec.tasklist
index f8b67701bf..aa43567270 100644
--- a/board/volteer/ec.tasklist
+++ b/board/volteer/ec.tasklist
@@ -9,6 +9,8 @@
#define CONFIG_TASK_LIST \
TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \
+ TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_ALWAYS(CONSOLE, console_task, NULL, VENTI_TASK_STACK_SIZE) \
- TASK_ALWAYS(POWERBTN, power_button_task, NULL, LARGER_TASK_STACK_SIZE)
+ TASK_ALWAYS(POWERBTN, power_button_task, NULL, LARGER_TASK_STACK_SIZE) \
+ TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE)