4.14-stable review patch.  If anyone has any objections, please let me know.


From: Hans de Goede <hdego...@redhat.com>

[ Upstream commit faec44b6838312484d63e82286087cf2d5ebb891 ]

We should not try to do any i2c transfers before the controller is
resumed (which happens before our resume method gets called).

So we need to disable our IRQ while suspended to enforce this. The
code paths for devices with GPIOs for the int and reset pins already
disable the IRQ the through goodix_free_irq().

This commit also disables the IRQ while suspended for devices without
GPIOs for the int and reset pins.

This fixes the i2c bus sometimes getting stuck after a suspend/resume
causing the touchscreen to sometimes not work after a suspend/resume.
This has been tested on a GPD pocked device.

BugLink: https://github.com/nexus511/gpd-ubuntu-packages/issues/10
Tested-by: Hans de Goede <hdego...@redhat.com>
Signed-off-by: Hans de Goede <hdego...@redhat.com>
Reviewed-by: Bastien Nocera <had...@hadess.net>
Signed-off-by: Dmitry Torokhov <dmitry.torok...@gmail.com>
Signed-off-by: Sasha Levin <alexander.le...@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
 drivers/input/touchscreen/goodix.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -808,8 +808,10 @@ static int __maybe_unused goodix_suspend
        int error;
        /* We need gpio pins to suspend/resume */
-       if (!ts->gpiod_int || !ts->gpiod_rst)
+       if (!ts->gpiod_int || !ts->gpiod_rst) {
+               disable_irq(client->irq);
                return 0;
+       }
@@ -849,8 +851,10 @@ static int __maybe_unused goodix_resume(
        struct goodix_ts_data *ts = i2c_get_clientdata(client);
        int error;
-       if (!ts->gpiod_int || !ts->gpiod_rst)
+       if (!ts->gpiod_int || !ts->gpiod_rst) {
+               enable_irq(client->irq);
                return 0;
+       }
         * Exit sleep mode by outputting HIGH level to INT pin

Reply via email to