]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
commit905dbf1d39d7f008acc46475384b33f98c512baf
tree27460ce12c96dbaee716fbf295f2a159543c0b82
parent7e0541b25702ccaa9560bdd2441caedca2d438e9
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