blob: 596bcc26bb960c813665a6557235de668e0e4a75 [file] [log] [blame]
From 3447337965b52d162fb0375db6d40ce44aaf5dd5 Mon Sep 17 00:00:00 2001
From: Evan Green <>
Date: Wed, 2 Oct 2019 14:00:21 -0700
Subject: [PATCH] Input: atmel_mxt_ts - disable IRQ across suspend
commit 463fa44eec2fef50d111ed0199cf593235065c04 upstream.
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 <>
Signed-off-by: Dmitry Torokhov <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 19378f200c63..f8c553dd0f2c 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -3156,6 +3156,8 @@ static int __maybe_unused mxt_suspend(struct device *dev)
+ disable_irq(data->irq);
return 0;
@@ -3168,6 +3170,8 @@ static int __maybe_unused mxt_resume(struct device *dev)
if (!input_dev)
return 0;
+ enable_irq(data->irq);
if (input_dev->users)