]> git.baikalelectronics.ru Git - kernel.git/commit
Input: iqs7222 - fortify slider event reporting
authorJeff LaBundy <jeff@labundy.com>
Mon, 27 Jun 2022 22:14:04 +0000 (15:14 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 27 Jun 2022 22:25:52 +0000 (15:25 -0700)
commit8096ae7187d054423289ac22155172f9356688d3
tree30d7c9c5727bea1cd802fcc30aba3dd308065a48
parente6ccbee8a4a16032237d9a82daf2b523f810d26e
Input: iqs7222 - fortify slider event reporting

The release cycle of any key mapped to a slider gesture relies upon
trailing interrupts generated by other unmasked sources, the timing
and presence of which are inconsistent.

To solve this problem, explicitly report a release cycle to emulate
a full keystroke. Also, unmask touch interrupts if the slider press
event is defined; this ensures the device reports a final interrupt
with coordinate = 0xFFFF once the finger is lifted.

As a result of how the logic has been refactored, the press/release
event can now be mapped to a GPIO. This is more convenient than the
previous solution, which required each channel within the slider to
specify the same GPIO.

As part of this change, use the device's resolution rather than its
number of interrupt status registers to more safely determine if it
is capable of reporting gestures.

Last but not least, make the code a bit simpler by eliminating some
unnecessarily complex conditional statements and a macro that could
be derived using information that is already available.

Fixes: a8b0abcc88cc ("Input: add support for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220626072412.475211-3-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/iqs7222.c