This is a note to let you know that I've just added the patch titled Input: st1232 - fix NORMAL vs. IDLE state handling to the 5.11-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: input-st1232-fix-normal-vs.-idle-state-handling.patch and it can be found in the queue-5.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 619ef8e1c8e75ba4eb764c2ed3cccde72006f6aa Author: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> Date: Tue Feb 23 09:30:09 2021 -0800 Input: st1232 - fix NORMAL vs. IDLE state handling [ Upstream commit 1bff77f41a805b16b5355497c217656711601282 ] NORMAL (0x0) and IDLE (0x4) are really two different states. Hence you cannot check for both using a bitmask, as that checks for IDLE only, breaking operation for devices that are in NORMAL state. Fix the wait function to report either state as ready. Fixes: 6524d8eac258452e ("Input: st1232 - add IDLE state as ready condition") Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> Reviewed-by: Michael Tretter <m.tretter@xxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20210223090201.1430542-1-geert+renesas@xxxxxxxxx Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c index 885f0572488dd..6abae665ca71d 100644 --- a/drivers/input/touchscreen/st1232.c +++ b/drivers/input/touchscreen/st1232.c @@ -94,8 +94,13 @@ static int st1232_ts_wait_ready(struct st1232_ts_data *ts) for (retries = 10; retries; retries--) { error = st1232_ts_read_data(ts, REG_STATUS, 1); - if (!error && ts->read_buf[0] == (STATUS_NORMAL | STATUS_IDLE | ERROR_NONE)) - return 0; + if (!error) { + switch (ts->read_buf[0]) { + case STATUS_NORMAL | ERROR_NONE: + case STATUS_IDLE | ERROR_NONE: + return 0; + } + } usleep_range(1000, 2000); }