summaryrefslogtreecommitdiff
path: root/common/keyboard_8042.c
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2018-08-09 11:53:38 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-08-20 03:27:39 -0700
commit28433e8bae44a39550e69f6b891444db246126e9 (patch)
tree3b33c832957a7cd6912bf34db9b8e18b56186188 /common/keyboard_8042.c
parente627fce49ece0908d1d2bf32d83cdc3718c3016b (diff)
downloadchrome-ec-28433e8bae44a39550e69f6b891444db246126e9.tar.gz
keyboard: Move keyboard_special (lightbar demo) to samus/board.c
Currently the keyboard_special has only one function - to enter demo or easter egg mode if lightbar task is running. However, only Samus has lightbar so we should not waste time doing keyboard_special on all boards. The better approach is to use the new CONFIG_KEYBOARD_SCANCODE_CALLBACK and provide the lightbar demo check inside samus board.c. BUG=None TEST=make buildall -j BRANCH=None Change-Id: Ie8ab994b5439309663328a75680d45230a6eaeea Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1168702 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/keyboard_8042.c')
-rw-r--r--common/keyboard_8042.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/common/keyboard_8042.c b/common/keyboard_8042.c
index b178c50066..7e906a1c04 100644
--- a/common/keyboard_8042.c
+++ b/common/keyboard_8042.c
@@ -108,7 +108,6 @@ static uint8_t controller_ram[0x20] = {
/* 0x01 - 0x1f are controller RAM */
};
static uint8_t A20_status;
-static void keyboard_special(uint16_t k);
/*
* Scancode settings
@@ -311,8 +310,6 @@ static enum ec_error_list matrix_callback(int8_t row, int8_t col,
return EC_ERROR_INVAL;
make_code = scancode_set2[row][col];
- if (pressed)
- keyboard_special(make_code);
#ifdef CONFIG_KEYBOARD_SCANCODE_CALLBACK
{
@@ -781,57 +778,6 @@ static void i8042_handle_from_host(void)
}
}
-/* U U D D L R L R b a */
-static void keyboard_special(uint16_t k)
-{
- static uint8_t s;
- static const uint16_t a[] = {
- SCANCODE_UP, SCANCODE_UP, SCANCODE_DOWN, SCANCODE_DOWN,
- SCANCODE_LEFT, SCANCODE_RIGHT, SCANCODE_LEFT, SCANCODE_RIGHT,
- SCANCODE_B, SCANCODE_A};
-
-#ifdef HAS_TASK_LIGHTBAR
- /* Lightbar demo mode: keyboard can fake the battery state */
- switch (k) {
- case SCANCODE_UP:
- demo_battery_level(1);
- break;
- case SCANCODE_DOWN:
- demo_battery_level(-1);
- break;
- case SCANCODE_LEFT:
- demo_is_charging(0);
- break;
- case SCANCODE_RIGHT:
- demo_is_charging(1);
- break;
- case SCANCODE_F6: /* dim */
- demo_brightness(-1);
- break;
- case SCANCODE_F7: /* bright */
- demo_brightness(1);
- break;
- case SCANCODE_T:
- demo_tap();
- break;
- }
-#endif
-
- if (k == a[s])
- s++;
- else if (k != SCANCODE_UP)
- s = 0;
- else if (s != 2)
- s = 1;
-
- if (s == ARRAY_SIZE(a)) {
- s = 0;
-#ifdef HAS_TASK_LIGHTBAR
- lightbar_sequence(LIGHTBAR_KONAMI);
-#endif
- }
-}
-
void keyboard_protocol_task(void *u)
{
int wait = -1;