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)
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>

No differences found