diff options
author | Paul Cercueil <paul@crapouillou.net> | 2017-10-13 11:04:48 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-10-19 16:50:39 -0700 |
commit | 9b5db7aab4d6b66f84f5e147c87eff4fe8b48651 (patch) | |
tree | 01fd4f72856762bb98cd8b75ab4c774bf60a108d /drivers/input/input.c | |
parent | 481c209fa016a9e594427a306718cdf48ceeb1c6 (diff) | |
download | blackbird-op-linux-9b5db7aab4d6b66f84f5e147c87eff4fe8b48651.tar.gz blackbird-op-linux-9b5db7aab4d6b66f84f5e147c87eff4fe8b48651.zip |
Input: goodix - poll the 'buffer status' bit before reading data
The Goodix panel triggers an interrupt on touch events. However, its
registers will contain the valid values a short time after the
interrupt, and not when it's raised. At that moment, the 'buffer status'
bit is set.
Previously, if the 'buffer status' bit was not set when the registers
were read, the data was discarded and no input event was emitted,
causing "finger down" or "finger up" events to be missed sometimes.
This went unnoticed until v4.9, as the DesignWare I2C driver commonly
used with this driver had enough latency for that bug to never trigger
until commit 2702ea7dbec5 ("i2c: designware: wait for disable/enable only
if necessary").
Now, in the IRQ handler we will poll (with a timeout) the 'buffer status'
bit and process the data of the panel as soon as this bit gets set.
Note that the Goodix panel will send a few spurious interrupts after the
'finger up' event, in which the 'buffer status' bit will never be set.
Cc: Bastien Nocera <hadess@hadess.net>
Cc: russianneuromancer@ya.ru
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
[hdegoede@redhat.com: Change poll loop to use jiffies,
add comment about typical poll time]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[dtor: rearranged control flow a bit to avoid explicit goto and double
check]
Reviewed-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/input.c')
0 files changed, 0 insertions, 0 deletions