mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 01:21:49 +00:00
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>
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user