summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2013-08-26 14:24:27 -0700
committerChromeBot <chrome-bot@google.com>2013-08-26 16:29:48 -0700
commit7fc3f64bdd56afc57a171e9e56239926aa0acaaa (patch)
treeb780a8be9e4d8cfd91438f625270385d60e549ae
parent2f2dd1ce89ab502db1110616ab7e726d3ac4a2d2 (diff)
downloadchrome-ec-7fc3f64bdd56afc57a171e9e56239926aa0acaaa.tar.gz
8042: Wake the keyboard scan task when keystrokes are enabled
Since the keyboard_scan_task is the only place that calls keyboard_raw_enable_interrupt(1) it is possible for the keyboard to be left with interrupts disabled/pending if the keyboard scan task is asleep. This change will wake the keyboard_scan_task when the 8042 keystroke_enable(1) is called, which will wake up the task and it will call into enable the keyboard interrupt and clear pending interrupts. I thought keyboard_enable() might be a better place to do this but that seems to cause a hung task when flashing firmware... This condition happens semi-regularly on resume on Falco and Peppy devices. There may be a better approach here so for now I am only commiting this to the Falco/Peppy firmware branch but a similar or better fix is probably needed in TOT. BUG=chrome-os-partner:22169 BRANCH=falco,peppy TEST=manual: many suspend/resume cycles on falco with the physical lid to ensure that the keyboard is still functional. Change-Id: I2f56f9c07b852c4b03b090d0da6b7128804962ab Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/66986 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--common/keyboard_8042.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/keyboard_8042.c b/common/keyboard_8042.c
index a31c8a2783..6fd2524bad 100644
--- a/common/keyboard_8042.c
+++ b/common/keyboard_8042.c
@@ -430,8 +430,10 @@ void keyboard_state_changed(int row, int col, int is_pressed)
static void keystroke_enable(int enable)
{
- if (!keystroke_enabled && enable)
+ if (!keystroke_enabled && enable) {
CPRINTF("[%T KS enable]\n");
+ task_wake(TASK_ID_KEYSCAN);
+ }
else if (keystroke_enabled && !enable)
CPRINTF("[%T KS disable]\n");