diff options
author | Matthias Schiffer <[email protected]> | 2022-06-08 14:48:02 +0200 |
---|---|---|
committer | Dmitry Torokhov <[email protected]> | 2022-09-23 13:00:13 -0700 |
commit | b4d6c6a07faa5c860421182d7599f12acfc7dfd0 (patch) | |
tree | da2a4f095d522c4b7524d764f6e5956d28a0be23 | |
parent | 33fe4d976ff2c1fb6caf961b2e7bbfa66b8a9bf6 (diff) |
Input: synaptics-rmi4 - fix command completion check for bootloader v7/v8
The command register is reset to 0 when a command has completed. Check
for this condition instead of the error status, which will not accurately
reflect completion. In particular, the incorrect condition caused every
command error to be reported as a timeout.
Signed-off-by: Matthias Schiffer <[email protected]>
Reviewed-by: Lyude Paul <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
-rw-r--r-- | drivers/input/rmi4/rmi_f34.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/input/rmi4/rmi_f34.c b/drivers/input/rmi4/rmi_f34.c index 3afc94f679ed..b811706fb77b 100644 --- a/drivers/input/rmi4/rmi_f34.c +++ b/drivers/input/rmi4/rmi_f34.c @@ -114,13 +114,13 @@ static irqreturn_t rmi_f34_attention(int irq, void *ctx) complete(&f34->v5.cmd_done); } else { ret = rmi_read_block(f34->fn->rmi_dev, - f34->fn->fd.data_base_addr + - f34->v7.off.flash_status, - &status, sizeof(status)); - rmi_dbg(RMI_DEBUG_FN, &fn->dev, "%s: status: %#02x, ret: %d\n", + f34->fn->fd.data_base_addr + + f34->v7.off.flash_cmd, + &status, sizeof(status)); + rmi_dbg(RMI_DEBUG_FN, &f34->fn->dev, "%s: cmd: %#02x, ret: %d\n", __func__, status, ret); - if (!ret && !(status & 0x1f)) + if (!ret && status == CMD_V7_IDLE) complete(&f34->v7.cmd_done); } |