diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-10-22 16:29:48 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-10-23 17:32:02 -0700 |
commit | cc263093d35b2b274b52ff182927f5a15634b4b6 (patch) | |
tree | e59463e700212c880fc06917fffbcad0819ab87f | |
parent | 090e4f5f8e7c8de473b26a8c0c437085d7c3db79 (diff) | |
download | chrome-ec-cc263093d35b2b274b52ff182927f5a15634b4b6.tar.gz |
Clean up keyboard_scan module
We only have one scan mask and no capability to change scan masks, so
don't reserve space for masks we're not using.
BUG=chrome-os-partner:15579
BRANCH=none
TEST=type on keyboard; should still work
Change-Id: I8ad0c5c894f93c2a79ca646e7666b3279c90a63c
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36347
-rw-r--r-- | chip/lm4/keyboard_scan.c | 24 | ||||
-rw-r--r-- | chip/stm32/keyboard_scan.c | 4 | ||||
-rw-r--r-- | include/keyboard_scan.h | 2 |
3 files changed, 7 insertions, 23 deletions
diff --git a/chip/lm4/keyboard_scan.c b/chip/lm4/keyboard_scan.c index d776a4f6ed..a07170dcfe 100644 --- a/chip/lm4/keyboard_scan.c +++ b/chip/lm4/keyboard_scan.c @@ -56,16 +56,10 @@ static uint8_t scan_edge_index[KB_COLS][8]; enum boot_key boot_key_value = BOOT_KEY_OTHER; /* Mask with 1 bits only for keys that actually exist */ -static const uint8_t *actual_key_mask; - -/* All actual key masks (todo: move to keyboard matrix definition) */ -static const uint8_t actual_key_masks[4][KB_COLS] = { - {0x14, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff, - 0xa4, 0xff, 0xf6, 0x55, 0xfa, 0xc8}, /* full set */ - {0}, - {0}, - {0}, - }; +static const uint8_t actual_key_mask[KB_COLS] = { + 0x14, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff, + 0xa4, 0xff, 0xf6, 0x55, 0xfa, 0xc8 /* full set */ +}; /* * Print all keyboard scan state changes? Off by default because it generates @@ -416,7 +410,7 @@ enum boot_key keyboard_scan_get_boot_key(void) return boot_key_value; } -int keyboard_scan_init(void) +void keyboard_scan_init(void) { /* Configure GPIO */ lm4_configure_keyboard_gpio(); @@ -424,12 +418,6 @@ int keyboard_scan_init(void) /* Tri-state the columns */ lm4_select_column(COLUMN_TRI_STATE_ALL); - /* - * TODO: method to set which keyboard we have, so we set the actual - * key mask properly. - */ - actual_key_mask = actual_key_masks[0]; - /* Initialize raw state */ read_matrix(debounced_state); memcpy(prev_state, debounced_state, sizeof(prev_state)); @@ -440,8 +428,6 @@ int keyboard_scan_init(void) /* Trigger event if recovery key was pressed */ if (boot_key_value == BOOT_KEY_ESC) host_set_single_event(EC_HOST_EVENT_KEYBOARD_RECOVERY); - - return EC_SUCCESS; } void keyboard_scan_task(void) diff --git a/chip/stm32/keyboard_scan.c b/chip/stm32/keyboard_scan.c index a16bd09edb..34c4f7147b 100644 --- a/chip/stm32/keyboard_scan.c +++ b/chip/stm32/keyboard_scan.c @@ -499,7 +499,7 @@ static int check_recovery_key(const uint8_t *state) } -int keyboard_scan_init(void) +void keyboard_scan_init(void) { /* Tri-state (put into Hi-Z) the outputs */ select_column(COL_TRI_STATE_ALL); @@ -510,8 +510,6 @@ int keyboard_scan_init(void) /* is recovery key pressed on cold startup ? */ check_recovery_key(debounced_state); - - return EC_SUCCESS; } /* Scan the keyboard until all keys are released */ diff --git a/include/keyboard_scan.h b/include/keyboard_scan.h index f92e8a3925..63384b10fb 100644 --- a/include/keyboard_scan.h +++ b/include/keyboard_scan.h @@ -11,7 +11,7 @@ #include "common.h" /* Initializes the module. */ -int keyboard_scan_init(void); +void keyboard_scan_init(void); /* Key held down at keyboard-controlled reset boot time. */ enum boot_key { |