Input: iqs7222 - handle reset during ATI
authorJeff LaBundy <jeff@labundy.com>
Mon, 27 Jun 2022 22:15:09 +0000 (15:15 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 27 Jun 2022 22:25:57 +0000 (15:25 -0700)
commit8635c68891c6d786d644747d599c41bdf512fbbf
treec79ac7bce8fc50d1b5d2e80e9976ef8902cff4a4
parent2e70ef525b7309287b2d4dd24e7c9c038a006328
Input: iqs7222 - handle reset during ATI

If the device suffers a spurious reset during ATI, there is no point
in enduring any further retries. Instead, simply return successfully
from the polling loop.

In this case, the interrupt handler will intervene and recognize the
device has been reset. It then proceeds to initialize the device and
trigger ATI once more.

As part of this change, swap the order of status field evaluation to
match that of the interrupt handler, and correct a nearby off-by-one
error that causes an error message to suggest the final attempt will
be retried.

Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220626072412.475211-6-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/iqs7222.c