]> git.baikalelectronics.ru Git - kernel.git/commit
Input: omap4-keypad - scan keys in two phases and simplify with bitmask
authorTony Lindgren <tony@atomide.com>
Mon, 11 Jan 2021 02:50:53 +0000 (18:50 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 11 Jan 2021 06:23:00 +0000 (22:23 -0800)
commit1ec7a970039f4af2900011dbda1ebcc80979675c
tree27460ce12c96dbaee716fbf295f2a159543c0b82
parentc55c9a75bf78d54b02705a2045016e798fc0c950
Input: omap4-keypad - scan keys in two phases and simplify with bitmask

Because of errata i689 the keyboard can idle with state where no key
up interrupts are seen until after the next key press.

This means we need to first check for any lost key up events before
scanning for new down events.

For example, rapidly pressing shift-shift-j can sometimes produce a J
instead of j. Let's fix the issue by scanning the keyboard in two
phases. First we scan for any key up events that we may have missed,
and then we scan for key down events.

Let's also simplify things with for_each_set_bit() as suggested by
Dmitry Torokhov <dmitry.torokhov@gmail.com>.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20210110190529.46135-3-tony@atomide.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/omap4-keypad.c