diff options
-rw-r--r-- | common/keyboard_scan.c | 8 | ||||
-rw-r--r-- | include/keyboard_8042.h | 7 | ||||
-rw-r--r-- | include/keyboard_protocol.h | 12 |
3 files changed, 17 insertions, 10 deletions
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c index dd97e7f757..876d06c9fc 100644 --- a/common/keyboard_scan.c +++ b/common/keyboard_scan.c @@ -472,11 +472,13 @@ static int check_keys_changed(uint8_t *state) state[c] ^= mask; any_change = 1; -#ifdef CONFIG_KEYBOARD_PROTOCOL_8042 /* Inform keyboard module if scanning is enabled */ - if (keyboard_scan_is_enabled()) + if (keyboard_scan_is_enabled()) { + /* This is no-op for protocols that require a + * full keyboard matrix (e.g., MKBP). + */ keyboard_state_changed(i, c, new_mask ? 1 : 0); -#endif + } } } diff --git a/include/keyboard_8042.h b/include/keyboard_8042.h index 2d58c4c184..00fdc9901b 100644 --- a/include/keyboard_8042.h +++ b/include/keyboard_8042.h @@ -28,11 +28,4 @@ void button_state_changed(enum keyboard_button_type button, int is_pressed); */ void keyboard_host_write(int data, int is_cmd); -/** - * Called by keyboard scan code once any key state change (after de-bounce), - * - * This function will look up matrix table and convert scancode host. - */ -void keyboard_state_changed(int row, int col, int is_pressed); - #endif /* __CROS_EC_KEYBOARD_8042_H */ diff --git a/include/keyboard_protocol.h b/include/keyboard_protocol.h index 6fc0a06f7c..a8eafe308d 100644 --- a/include/keyboard_protocol.h +++ b/include/keyboard_protocol.h @@ -35,6 +35,18 @@ void keyboard_update_button(enum keyboard_button_type button, int is_pressed); #ifdef CONFIG_KEYBOARD_PROTOCOL_MKBP #include "keyboard_mkbp.h" + +/* MKBP protocol takes the whole keyboard matrix, and does not care about + * individual key presses. + */ +static inline void keyboard_state_changed(int row, int col, int is_pressed) {} +#else +/** + * Called by keyboard scan code once any key state change (after de-bounce), + * + * This function will look up matrix table and convert scancode host. + */ +void keyboard_state_changed(int row, int col, int is_pressed); #endif #endif /* __CROS_EC_KEYBOARD_PROTOCOL_H */ |