From 2efff2146cbe1f2f7b63012cf95aaf1d86f02f38 Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Wed, 2 May 2018 09:25:00 -0600 Subject: [PATCH] bip: add keyboard functionality BRANCH=none BUG=none TEST=builds Change-Id: Iaea766ab55a4d55cb3df5254b55ee460a820f55d Signed-off-by: Jett Rink Reviewed-on: https://chromium-review.googlesource.com/1039872 Reviewed-by: Furquan Shaikh Reviewed-by: Vijay Hiremath Reviewed-by: Justin TerAvest --- board/bip/board.c | 22 ++++++++++++++++++++++ board/bip/board.h | 3 +++ board/bip/ec.tasklist | 1 + 3 files changed, 26 insertions(+) diff --git a/board/bip/board.c b/board/bip/board.c index 4c81ac17f0..e5beea871f 100644 --- a/board/bip/board.c +++ b/board/bip/board.c @@ -175,6 +175,28 @@ const int usb_port_enable[USB_PORT_COUNT] = { GPIO_EN_USB_A1_5V, }; +/******************************************************************************/ +/* Keyboard scan setting */ +struct keyboard_scan_config keyscan_config = { + /* + * F3 key scan cycle completed but scan input is not + * charging to logic high when EC start scan next + * column for "T" key, so we set .output_settle_us + * to 80us from 50us. + */ + .output_settle_us = 80, + .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 */ + }, +}; + + /* TODO(crbug.com/826441): Consolidate this logic with other impls */ static void board_it83xx_hpd_status(int port, int hpd_lvl, int hpd_irq) { diff --git a/board/bip/board.h b/board/bip/board.h index fb2e7f0b3c..908855a478 100644 --- a/board/bip/board.h +++ b/board/bip/board.h @@ -106,7 +106,10 @@ #define CONFIG_ESPI /* TODO(b/76023457): Enable Virtual Wires after bringup */ #define CONFIG_LPC +#define CONFIG_KEYBOARD_BOARD_CONFIG #define CONFIG_KEYBOARD_PROTOCOL_8042 +#define CONFIG_KEYBOARD_COL2_INVERTED +#define CONFIG_KEYBOARD_PWRBTN_ASSERTS_KSI2 #define CONFIG_POWER_COMMON #define CONFIG_POWER_S0IX #define CONFIG_POWER_TRACK_HOST_SLEEP_STATE diff --git a/board/bip/ec.tasklist b/board/bip/ec.tasklist index 65a4100a37..2a5ea99ad1 100644 --- a/board/bip/ec.tasklist +++ b/board/bip/ec.tasklist @@ -31,5 +31,6 @@ 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_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(PD_C1, pd_task, NULL, LARGER_TASK_STACK_SIZE)