Input: omap4-keypad - implement errata check for lost key-up events
authorTony Lindgren <tony@atomide.com>
Mon, 11 Jan 2021 06:20:25 +0000 (22:20 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 11 Jan 2021 06:23:04 +0000 (22:23 -0800)
commit2f6aa61d87e7d93c39e37b7ba2c4a9035000a0c8
treed02b0ebf084857b73d404199721147da571d10ac
parent29bf35e5ee808dbbcc8cff7a0bf6d4349148b586
Input: omap4-keypad - implement errata check for lost key-up events

We are still missing handling for errata i689 related issues for the
case where we never see a key up interrupt for the last pressed key.

To fix the issue, we must scan the key state again after the keyboard
controller has idled to check if a key up event was missed. This is
described in the omap4 silicon errata documentation for Errata ID i689
"1.32 Keyboard Key Up Event Can Be Missed":

"When a key is released for a time shorter than the debounce time,
 in-between 2 key press (KP1 and KP2), the keyboard state machine will go
 to idle mode and will never detect the key release (after KP1, and also
 after KP2), and thus will never generate a new IRQ indicating the key
 release."

We can use PM runtime autosuspend features to check the keyboard state
after it enters idle.

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