Input: goodix - disable IRQs while suspended
Subsystems (3)
PATCH v2 1/1 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.
---
Changes in v2:
-Mention the problems this fix + devices tested on in commit msg -Add BugLinks and Tested-by to commit msg
--- drivers/input/touchscreen/goodix.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/input/touchscreen/goodix.c +6 -2
@@ -878,8 +878,10 @@ static int __maybe_unused goodix_suspend(struct device *dev)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 ; + }wait_for_completion (&ts->firmware_loading_complete);
@@ -919,8 +921,10 @@ static int __maybe_unused goodix_resume(struct device *dev)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
Signature · 1 line
2.14.3
Quoted 7 lines · Hans de Goede
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().
Quoted 6 lines
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.
pocket?
Quoted 44 lines
roken_touch_after_resume_all_linux/
Tested-by Hans de Goede <[email protected]>Signed-off-by Hans de Goede <[email protected]>---
Changes in v2:(quoted diff) +0
-3-Mention the problems this fix + devices tested on in commit msg -Add BugLinks and Tested-by to commit msg --- drivers/input/touchscreen/goodix.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/input/touchscreen/goodix.c +6
-2@@ -878,8 +878,10 @@ static int __maybe_unused goodix_suspend(struct device *dev)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 ; + }wait_for_completion (&ts->firmware_loading_complete);@@ -919,8 +921,10 @@ static int __maybe_unused goodix_resume(struct device *dev)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
Hi,
Quoted 8 lines · Bastien Nocera
Quoted 7 lines · Hans de Goede
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().
Quoted 8 lines
Quoted 6 lines
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.
pocket?
Erm, yes.
Regards,
Hans
Quoted 47 lines
Reviewed-by Bastien Nocera <[email protected]>Quoted 44 lines
roken_touch_after_resume_all_linux/
Tested-by Hans de Goede <[email protected]>Signed-off-by Hans de Goede <[email protected]>---
Changes in v2:(quoted diff) +0
-3-Mention the problems this fix + devices tested on in commit msg -Add BugLinks and Tested-by to commit msg --- drivers/input/touchscreen/goodix.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/input/touchscreen/goodix.c +6
-2@@ -878,8 +878,10 @@ static int __maybe_unused goodix_suspend(struct device *dev)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 ; + }wait_for_completion (&ts->firmware_loading_complete);@@ -919,8 +921,10 @@ static int __maybe_unused goodix_resume(struct device *dev)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