summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Green <evgreen@chromium.org>2019-10-03 00:00:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-04 21:12:36 +0300
commitf6123db9773afff69e53ea9e97869155f26452e7 (patch)
tree9d46790b0f4a4e6ca4eacaea9158d5778e7c8ffb
parentc89e1186012ebc1751ada93e8ff4e3c60866e81b (diff)
downloadlinux-f6123db9773afff69e53ea9e97869155f26452e7.tar.xz
Input: atmel_mxt_ts - disable IRQ across suspend
[ Upstream commit 463fa44eec2fef50d111ed0199cf593235065c04 ] Across suspend and resume, we are seeing error messages like the following: atmel_mxt_ts i2c-PRP0001:00: __mxt_read_reg: i2c transfer failed (-121) atmel_mxt_ts i2c-PRP0001:00: Failed to read T44 and T5 (-121) This occurs because the driver leaves its IRQ enabled. Upon resume, there is an IRQ pending, but the interrupt is serviced before both the driver and the underlying I2C bus have been resumed. This causes EREMOTEIO errors. Disable the IRQ in suspend, and re-enable it on resume. If there are cases where the driver enters suspend with interrupts disabled, that's a bug we should fix separately. Signed-off-by: Evan Green <evgreen@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/input/touchscreen/atmel_mxt_ts.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index a7ace07e179e..e8f98de60df3 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -3162,6 +3162,8 @@ static int __maybe_unused mxt_suspend(struct device *dev)
mutex_unlock(&input_dev->mutex);
+ disable_irq(data->irq);
+
return 0;
}
@@ -3174,6 +3176,8 @@ static int __maybe_unused mxt_resume(struct device *dev)
if (!input_dev)
return 0;
+ enable_irq(data->irq);
+
mutex_lock(&input_dev->mutex);
if (input_dev->users)