diff options
author | Duncan Laurie <dlaurie@chromium.org> | 2013-08-26 14:24:27 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-09-10 22:47:14 +0000 |
commit | 24570b30a89c60a43a00293f36bc76a43681abc2 (patch) | |
tree | e920617d886055ef515b4d89c0bd6c94ecbf60f3 | |
parent | e1557f72df2f8e54ffd33e3dd4842b405cdda43c (diff) | |
download | chrome-ec-24570b30a89c60a43a00293f36bc76a43681abc2.tar.gz |
CHERRY-PICK: 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: I3e0a4ea3b6cbc68ebc1941600e2c92a49a515e9f
Original-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>
Reviewed-on: https://chromium-review.googlesource.com/168815
Commit-Queue: Mohammed Habibulla <moch@google.com>
Tested-by: Mohammed Habibulla <moch@google.com>
-rw-r--r-- | common/keyboard_8042.c | 4 |
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"); |