Input: cros_ec_keyb - optimize ghosting algorithm
authorTodd Broch <tbroch@chromium.org>
Wed, 3 Sep 2014 23:56:12 +0000 (16:56 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 4 Sep 2014 00:07:05 +0000 (17:07 -0700)
commit017f14e88bf15ca96eb377b3b14fc3c3332e6b9b
tree358f0ae1a095964bbb9c4aaadf00b89507534b5e
parent516d5f8b04ce2bcd24f03323fc743ae25b81373d
Input: cros_ec_keyb - optimize ghosting algorithm

Previous algorithm was a bit conservative and complicating with respect to
identifying key ghosting.  This CL uses the bitops hamming weight function
(hweight8) to count the number of matching rows for colM & colN.  If that
number is > 1 ghosting is present.

Additionally it removes NULL keys and our one virtual keypress KEY_BATTERY
from consideration as these inputs are never physical keypresses.

Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/cros_ec_keyb.c