summaryrefslogtreecommitdiff
path: root/baseboard/hatch/baseboard.c
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-12-19 11:05:59 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-30 13:06:36 -0800
commitf0efcfb98fa5fca8a7c56b10ea48b808cc0f144a (patch)
tree669b3c983412c2ff8e28882646179f5e3b72b094 /baseboard/hatch/baseboard.c
parent01f8d598f8bbd5f9d7400d17284e3dbac270d491 (diff)
downloadchrome-ec-f0efcfb98fa5fca8a7c56b10ea48b808cc0f144a.tar.gz
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 <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1387589 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Zack Yang <zack_yang@compal.corp-partner.google.com> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Diffstat (limited to 'baseboard/hatch/baseboard.c')
-rw-r--r--baseboard/hatch/baseboard.c22
1 files changed, 22 insertions, 0 deletions
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"
@@ -34,6 +35,27 @@
#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[] = {
{"sensor", I2C_PORT_SENSOR, 100, GPIO_I2C0_SCL, GPIO_I2C0_SDA},