]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Input: atkbd - fix multi-byte scancode handling on reconnect
authorShawn Nematbakhsh <shawnn@chromium.org>
Mon, 31 Dec 2012 20:53:35 +0000 (12:53 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 22 Jan 2013 01:31:40 +0000 (17:31 -0800)
commitbe2d7e4233a4fe439125b825470020cef83407d5
treef7c8b61c3e66070d0b3a44cb5498effcb268b2f4
parent4a31ba37b7ed39c9c7178da6e6df7bce63ffc56f
Input: atkbd - fix multi-byte scancode handling on reconnect

On resume from suspend there is a possibility for multi-byte scancodes
to be handled incorrectly. atkbd_reconnect disables the processing of
scancodes in software by calling atkbd_disable, but the keyboard may
still be active because no disconnect command was sent. Later, software
handling is re-enabled. If a multi-byte scancode sent from the keyboard
straddles the re-enable, only the latter byte(s) will be handled.

In practice, this leads to cases where multi-byte break codes (ex. "e0
4d" - break code for right-arrow) are misread as make codes ("4d" - make
code for numeric 6), leading to one or more unwanted, untyped characters
being interpreted.

The solution implemented here involves sending command f5 (reset
disable) to the keyboard prior to disabling software handling of codes.
Later, the command to re-enable the keyboard is sent only after we are
prepared to handle scancodes.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/atkbd.c