summaryrefslogtreecommitdiff
path: root/common/keyboard_mkbp.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-10-24 10:19:55 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-30 23:10:13 +0000
commitd16a246ea9c7d5982d4eb932c09310146ab3463e (patch)
tree780645ec6acc8496e367d5a34f9cc23020a650c9 /common/keyboard_mkbp.c
parente48a9d9c2143695cdd7a35ab06d6a6d5820efd9b (diff)
downloadchrome-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/keyboard_mkbp.c')
-rw-r--r--common/keyboard_mkbp.c10
1 files changed, 0 insertions, 10 deletions
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