Input: atmel_mxt_ts - disable IRQ across suspend
authorEvan Green <evgreen@chromium.org>
Wed, 2 Oct 2019 21:00:21 +0000 (14:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 18:16:29 +0000 (19:16 +0100)
commitfac68e77e87e56f679be6d60acc8494fc7662116
tree11288ac5a1fce22492c4e3559fff3278043eaf91
parent03d0de2da8806a801c7f1d3e1f113f2a5aeec745
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>
drivers/input/touchscreen/atmel_mxt_ts.c