• Hans de Goede's avatar
    Input: goodix - try not to touch the reset-pin on x86/ACPI devices · a2fd46cd
    Hans de Goede authored
    Unless the controller is not responding at boot or after suspend/resume,
    the driver never resets the controller on x86/ACPI platforms. The driver
    still requesting the reset pin at probe() though in case it needs it.
    
    Until now the driver has always requested the reset pin with GPIOD_IN
    as type. The idea being to put the pin in high-impedance mode to save
    power until the driver actually wants to issue a reset.
    
    But this means that just requesting the pin can cause issues, since
    requesting it in another mode then GPIOD_ASIS may cause the pinctrl
    driver to touch the pin settings. We have already had issues before
    due to a bug in the pinctrl-cherryview.c driver which has been fixed in
    commit 921daeec ("pinctrl: cherryview: Preserve
    CHV_PADCTRL1_INVRXTX_TXDATA flag on GPIOs").
    
    And now it turns out that requesting the reset-pin as GPIOD_IN also stops
    the touchscreen from working on the GPD P2 max mini-laptop. The behavior
    of putting the pin in high-impedance mode relies on there being some
    external pull-up to keep it high and there seems to be no pull-up on the
    GPD P2 max, causing things to break.
    
    This commit fixes this by requesting the reset pin as is when using
    the x86/ACPI code paths to lookup the GPIOs; and by not dropping it
    back into input-mode in case the driver does end up issuing a reset
    for error-recovery.
    
    BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=209061
    Fixes: a7d4b171 ("Input: goodix - add support for getting IRQ + reset GPIOs on Cherry Trail devices")
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Link: https://lore.kernel.org/r/20211206091116.44466-2-hdegoede@redhat.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
    a2fd46cd
goodix.h 3.42 KB