diff options
author | Louis Yung-Chieh Lo <yjlou@chromium.org> | 2012-06-11 16:39:10 +0800 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-06-11 19:54:56 -0700 |
commit | 8c44e8b74d79a31a810391511fbe7c73f0bc59d4 (patch) | |
tree | 8f36a00abb9576be39bdb1f04be4106086a32ea3 | |
parent | 3439e70a901477133ed0a22eea55afdd4fc89f7b (diff) | |
download | chrome-ec-8c44e8b74d79a31a810391511fbe7c73f0bc59d4.tar.gz |
Fix the keyboard bug on recovery screen.
This bug unexpectedly comes from 2 related features:
1. Issue chrome-os-partner:7486: stop driving keyboard columns ASAP when
power button is pressed. This is to avoid the keys on ESC column to
reset the system if the power button is also pressed. This is done by
keyboard_enable_scanning(0) in power_button_interrupt().
2. During the booting, the power button state is set to BOOT_RECOVERY and
will ignore the power button release (to avoid confusing the host).
However, before the state is set back to IDLE, the
power_button_interrupt() can be triggered ever so that the matrix scan
is disabled.
Therefore, we have to enable the matrix scan in the BOOT_RECOVERY (and
the derived EAT_RELEASE) because they ignore power button release.
Note that in the regular states, the power_button_released() is called
after debounce time. They are fine.
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
BUG=chrome-os-partner:10358
TEST=Press ESC+Refresh+Power for many many times with vatious hold time.
The tab key works to disable the recovery reason.
Change-Id: Ic05fc6e22caadb4a3892a4b201dd5bfc7e9c3f44
Reviewed-on: https://gerrit.chromium.org/gerrit/24991
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Tested-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
-rw-r--r-- | chip/lm4/power_button.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chip/lm4/power_button.c b/chip/lm4/power_button.c index b144d00b62..1ef91ead6c 100644 --- a/chip/lm4/power_button.c +++ b/chip/lm4/power_button.c @@ -272,6 +272,7 @@ static void power_button_changed(uint64_t tnow) * told the PCH the power button was released. */ CPRINTF("[%T PB ignoring release]\n"); pwrbtn_state = PWRBTN_STATE_IDLE; + keyboard_enable_scanning(1); return; } @@ -433,10 +434,12 @@ static void state_machine(uint64_t tnow) * recovery combination doesn't cause the chipset to shut back * down. */ set_pwrbtn_to_pch(1); - if (get_power_button_pressed()) + if (get_power_button_pressed()) { pwrbtn_state = PWRBTN_STATE_EAT_RELEASE; - else + } else { pwrbtn_state = PWRBTN_STATE_IDLE; + keyboard_enable_scanning(1); + } break; case PWRBTN_STATE_WAS_OFF: /* Done stretching initial power button signal, so show the |