aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2018-01-12 03:36:48 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2018-01-12 03:42:47 -0500
commitfaec44b6838312484d63e82286087cf2d5ebb891 (patch)
treef9cc3b18a0f0b4289c2507b019677b27a29e988c
parent152194fe9c3f03232b9c0d0264793a7fa4af82f8 (diff)
Input: goodix - disable IRQs while suspended
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 BugLink: https://www.reddit.com/r/GPDPocket/comments/7niut2/fix_for_broken_touch_after_resume_all_linux/ Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/touchscreen/goodix.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index 69d0b8cbc71f..ecec8eb17f28 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -878,8 +878,10 @@ static int __maybe_unused goodix_suspend(struct device *dev)
878 int error; 878 int error;
879 879
880 /* We need gpio pins to suspend/resume */ 880 /* We need gpio pins to suspend/resume */
881 if (!ts->gpiod_int || !ts->gpiod_rst) 881 if (!ts->gpiod_int || !ts->gpiod_rst) {
882 disable_irq(client->irq);
882 return 0; 883 return 0;
884 }
883 885
884 wait_for_completion(&ts->firmware_loading_complete); 886 wait_for_completion(&ts->firmware_loading_complete);
885 887
@@ -919,8 +921,10 @@ static int __maybe_unused goodix_resume(struct device *dev)
919 struct goodix_ts_data *ts = i2c_get_clientdata(client); 921 struct goodix_ts_data *ts = i2c_get_clientdata(client);
920 int error; 922 int error;
921 923
922 if (!ts->gpiod_int || !ts->gpiod_rst) 924 if (!ts->gpiod_int || !ts->gpiod_rst) {
925 enable_irq(client->irq);
923 return 0; 926 return 0;
927 }
924 928
925 /* 929 /*
926 * Exit sleep mode by outputting HIGH level to INT pin 930 * Exit sleep mode by outputting HIGH level to INT pin