diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-10-24 10:19:55 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-10-30 23:10:13 +0000 |
commit | d16a246ea9c7d5982d4eb932c09310146ab3463e (patch) | |
tree | 780645ec6acc8496e367d5a34f9cc23020a650c9 /common | |
parent | e48a9d9c2143695cdd7a35ab06d6a6d5820efd9b (diff) | |
download | chrome-ec-d16a246ea9c7d5982d4eb932c09310146ab3463e.tar.gz |
cleanup: mkbp keyboard module
Rather than compile it by default for host-based tests, only compile
it for the few tests that actually use it. Since those (and all
boards) now only use if if they also have a keyscan task, we can get
rid of the #ifdefs in keyboard_mkbp.c as well.
And remove a TODO we'll never do...
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all boards; pass unit tests. These pass:
util/make_all.sh
make BOARD=pit tests
Change-Id: I44d1806cfb375027a7ed0b33a5e9bdbbed8ccddc
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174513
Diffstat (limited to 'common')
-rw-r--r-- | common/extpower_spring.c | 2 | ||||
-rw-r--r-- | common/keyboard_mkbp.c | 10 |
2 files changed, 1 insertions, 11 deletions
diff --git a/common/extpower_spring.c b/common/extpower_spring.c index 14bc864cf1..022788704b 100644 --- a/common/extpower_spring.c +++ b/common/extpower_spring.c @@ -16,7 +16,7 @@ #include "gpio.h" #include "hooks.h" #include "host_command.h" -#include "keyboard_protocol.h" +#include "keyboard_mkbp.h" #include "pmu_tpschrome.h" #include "pwm.h" /* TODO(rspangler): files in common should not use chip registers directly */ diff --git a/common/keyboard_mkbp.c b/common/keyboard_mkbp.c index 33ba1e782a..d5343cdf36 100644 --- a/common/keyboard_mkbp.c +++ b/common/keyboard_mkbp.c @@ -156,12 +156,8 @@ void keyboard_send_battery_key(void) { uint8_t state[KEYBOARD_COLS]; -#ifdef HAS_TASK_KEYSCAN /* Copy debounced state and add battery pseudo-key */ memcpy(state, keyboard_scan_get_state(), sizeof(state)); -#else - memset(state, 0, sizeof(state)); -#endif state[BATTERY_KEY_COL] ^= BATTERY_KEY_ROW_MASK; /* Add to FIFO only if AP is on or else it will wake from suspend */ @@ -206,7 +202,6 @@ 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) { -#ifdef HAS_TASK_KEYSCAN struct keyboard_scan_config *ksc = keyboard_scan_get_config(); if (valid_mask & EC_MKBP_VALID_SCAN_PERIOD) @@ -241,12 +236,10 @@ static void set_keyscan_config(const struct ec_mkbp_config *src, if ((new_flags & EC_MKBP_FLAGS_ENABLE) && !(dst->flags & EC_MKBP_FLAGS_ENABLE)) task_wake(TASK_ID_KEYSCAN); -#endif } static void get_keyscan_config(struct ec_mkbp_config *dst) { -#ifdef HAS_TASK_KEYSCAN const struct keyboard_scan_config *ksc = keyboard_scan_get_config(); /* Copy fields from keyscan config to mkbp config */ @@ -256,7 +249,6 @@ static void get_keyscan_config(struct ec_mkbp_config *dst) dst->scan_period_us = ksc->scan_period_us; dst->min_post_scan_delay_us = ksc->min_post_scan_delay_us; dst->poll_timeout_us = ksc->poll_timeout_us; -#endif } /** @@ -265,8 +257,6 @@ static void get_keyscan_config(struct ec_mkbp_config *dst) * This is like a structure copy, except that only selected fields are * copied. * - * TODO(sjg@chromium.org): Consider making this table driven as ectool. - * * @param src Source config * @param dst Destination config * @param valid_mask Bits representing which fields to copy - each bit is |