From ce31c1d704b6343cc095e5e57ded0e3c2467caad Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 9 Apr 2019 02:28:41 -0400 Subject: [PATCH] elan: Work-around one-byte responses being two-bytes long On the ELAN_0C42 device, one-byte responses are 2 bytes long. Adapt our expected response length. --- libfprint/drivers/elan.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libfprint/drivers/elan.c b/libfprint/drivers/elan.c index 3216bf1..46346be 100644 --- a/libfprint/drivers/elan.c +++ b/libfprint/drivers/elan.c @@ -383,6 +383,12 @@ static void elan_cmd_read(fpi_ssm *ssm, struct fp_img_dev *dev) return; } + if (elandev->dev_type == ELAN_0C42) { + /* ELAN_0C42 sends an extra byte in one byte responses */ + if (elandev->cmd->response_len == 1) + response_len = 2; + } + if (elandev->cmd->cmd == get_image_cmd.cmd) /* raw data has 2-byte "pixels" and the frame is vertical */ response_len =