• Jeff LaBundy's avatar
    Input: iqs7222 - fortify slider event reporting · 95215d3d
    Jeff LaBundy authored
    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: e505edae
    
     ("Input: add support for Azoteq IQS7222A/B/C")
    Signed-off-by: default avatarJeff LaBundy <jeff@labundy.com>
    Link: https://lore.kernel.org/r/20220626072412.475211-3-jeff@labundy.com
    
    Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
    95215d3d
iqs7222.c 58.4 KB