From f0efcfb98fa5fca8a7c56b10ea48b808cc0f144a Mon Sep 17 00:00:00 2001 From: Scott Collyer Date: Wed, 19 Dec 2018 11:05:59 -0800 Subject: hatch: Add support for keyboard scan This CL adds config options and GPIO alternate function definitions required for adding keyboard scan functionality. BRANCH=none BUG=b:122251649 TEST=make buildall Change-Id: I9511f936e12d25276fa2685afbf7edaa6330d2cf Signed-off-by: Scott Collyer Reviewed-on: https://chromium-review.googlesource.com/1387589 Commit-Ready: Scott Collyer Tested-by: Scott Collyer Reviewed-by: Aseda Aboagye Reviewed-by: Zack Yang Reviewed-by: Vijay P Hiremath --- baseboard/hatch/baseboard.c | 22 ++++++++++++++++++++++ baseboard/hatch/baseboard.h | 8 ++++++++ 2 files changed, 30 insertions(+) (limited to 'baseboard') diff --git a/baseboard/hatch/baseboard.c b/baseboard/hatch/baseboard.c index 78930e4f36..71a28a3faa 100644 --- a/baseboard/hatch/baseboard.c +++ b/baseboard/hatch/baseboard.c @@ -18,6 +18,7 @@ #include "gpio.h" #include "hooks.h" #include "i2c.h" +#include "keyboard_scan.h" #include "power.h" #include "tcpci.h" #include "timer.h" @@ -33,6 +34,27 @@ #define USB_PD_PORT_TCPC_0 0 #define USB_PD_PORT_TCPC_1 1 +/******************************************************************************/ +/* 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 */ + }, +}; + /******************************************************************************/ /* I2C port map configuration */ const struct i2c_port_t i2c_ports[] = { diff --git a/baseboard/hatch/baseboard.h b/baseboard/hatch/baseboard.h index c95cfec9d6..9eb62fc528 100644 --- a/baseboard/hatch/baseboard.h +++ b/baseboard/hatch/baseboard.h @@ -34,6 +34,14 @@ /* #define CONFIG_POWER_S0IX */ /* #define CONFIG_POWER_TRACK_HOST_SLEEP_STATE */ +/* 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 + /* Common charger defines */ #define CONFIG_CHARGE_MANAGER /* #define CONFIG_CHARGE_RAMP_HW */ -- cgit v1.2.1