CHROMIUM: Strengthen ghosting algorithm.
authorTodd Broch <tbroch@chromium.org>
Tue, 26 Mar 2013 22:53:49 +0000 (15:53 -0700)
committerChromeBot <chrome-bot@google.com>
Tue, 16 Apr 2013 19:43:17 +0000 (12:43 -0700)
commit688c20f457b6111755cf1f9f1b1472693a4a4ed9
tree76cf576e1a645c75c456665060523705c6da0d14
parent22750f1711233f24e11ef83413347fb6cdd07098
CHROMIUM: Strengthen ghosting algorithm.

Previous commit added the interpretation of the virtual keystroke from
EC's MKBP, KEY_BATTERY, to allow EC to signal change in USB power for
Spring.

While the edit did address suppressing the input event the virtual
keystroke still plays into the ghosting calculation.  This exposed
that the ghosting algorithm was too conservative as ctrl + u +
KEY_BATTERY triggered ghosting logic.

New algorithm correctly identifies all ghosting (3 or more) keystrokes
by factoring in whether the ghost key is valid.

Signed-off-by: Todd Broch <tbroch@chromium.org>
BUG=chrome-os-partner:18354
TEST=manual
1. using evtest I now see ctrl-U
2. escape sequence ctrl-U correctly display 'webpage source'
3. w/ #define DEBUG in mkbp.c no longer see below when ctrl-U pressed
   chromeos-ec-i2c 4-001e: ghost found at: r7 c6, pressed 2, teeth 0x4

Change-Id: I693bee2d0e54081c267f449f4b2c7f20a20749ff
Reviewed-on: https://gerrit.chromium.org/gerrit/46585
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
drivers/input/keyboard/mkbp.c