summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2017-02-16 01:27:32 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-02-21 16:07:40 -0800
commit551e56ea061afe5c65db1413fa3abfdd05b43564 (patch)
tree2736ca07a291e98c1984758c85a8b2c2c07081b7
parent6f75a681f47582ad897cd4dd548fce6dea432c39 (diff)
downloadchrome-ec-551e56ea061afe5c65db1413fa3abfdd05b43564.tar.gz
mkbp: Support devices having buttons but no keyboard
If we turn on CONFIG_KEYBOARD_PROTOCOL_MKBP on devices without keyscan task, we'll see a few compile errors due to dependencies on keyscan. This is the fix. BUG=chrome-os-partner:62987 BRANCH=none TEST=make buildall -j Change-Id: Ib0dd1570f0e1a2de084cf1c5f75b8e3ad1cb301a Reviewed-on: https://chromium-review.googlesource.com/443745 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/444946 Commit-Ready: Philip Chen <philipchen@chromium.org>
-rw-r--r--common/keyboard_mkbp.c5
-rw-r--r--include/config.h5
2 files changed, 4 insertions, 6 deletions
diff --git a/common/keyboard_mkbp.c b/common/keyboard_mkbp.c
index 6839cef707..277e63dc03 100644
--- a/common/keyboard_mkbp.c
+++ b/common/keyboard_mkbp.c
@@ -411,12 +411,13 @@ static int mkbp_get_info(struct host_cmd_handler_args *args)
case EC_MKBP_INFO_CURRENT:
switch (p->event_type) {
+#ifdef HAS_TASK_KEYSCAN
case EC_MKBP_EVENT_KEY_MATRIX:
memcpy(r->key_matrix, keyboard_scan_get_state(),
sizeof(r->key_matrix));
args->response_size = sizeof(r->key_matrix);
break;
-
+#endif
case EC_MKBP_EVENT_HOST_EVENT:
r->host_event = host_get_events();
args->response_size = sizeof(r->host_event);
@@ -448,6 +449,7 @@ static int mkbp_get_info(struct host_cmd_handler_args *args)
DECLARE_HOST_COMMAND(EC_CMD_MKBP_INFO, mkbp_get_info,
EC_VER_MASK(0) | EC_VER_MASK(1));
+#ifdef HAS_TASK_KEYSCAN
static void set_keyscan_config(const struct ec_mkbp_config *src,
struct ec_mkbp_protocol_config *dst,
uint32_t valid_mask, uint8_t new_flags)
@@ -570,3 +572,4 @@ static int host_command_mkbp_get_config(struct host_cmd_handler_args *args)
DECLARE_HOST_COMMAND(EC_CMD_MKBP_GET_CONFIG,
host_command_mkbp_get_config,
EC_VER_MASK(0));
+#endif /* HAS_TASK_KEYSCAN */
diff --git a/include/config.h b/include/config.h
index 4f4cf29323..3b452b5a47 100644
--- a/include/config.h
+++ b/include/config.h
@@ -2636,11 +2636,6 @@
*/
#endif
-#ifndef HAS_TASK_KEYSCAN
-#undef CONFIG_KEYBOARD_PROTOCOL_8042
-#undef CONFIG_KEYBOARD_PROTOCOL_MKBP
-#endif
-
#ifndef HAS_TASK_PDCMD
#undef CONFIG_HOSTCMD_PD
#endif