From 834c2e12b7fc2367b92e1e99f7c8ed19c1d1e477 Mon Sep 17 00:00:00 2001 From: Franklin S Cooper Jr Date: Wed, 7 Oct 2015 04:52:22 -0500 Subject: [PATCH] Input: edt-ft5x06 - Use max support points to determine read length Calculate the amount of data that needs to be read for specified max number of support points. If the maximum number of support points changes then the amount that is read from the touch screen controller should reflect this. Signed-off-by: Franklin S Cooper Jr Signed-off-by: Sekhar Nori --- drivers/input/touchscreen/edt-ft5x06.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index ffb0e5f..0ef9988 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -180,14 +180,16 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id) cmd = 0xf9; /* tell the controller to send touch data */ offset = 5; /* where the actual touch data starts */ tplen = 4; /* data comes in so called frames */ - datalen = 26; /* how much bytes to listen for */ + + /* how many bytes to listen for */ + datalen = tplen * MAX_SUPPORT_POINTS + offset + 1; break; case M09: cmd = 0x02; offset = 1; tplen = 6; - datalen = 29; + datalen = tplen * MAX_SUPPORT_POINTS + 1 - cmd; break; default: -- 1.9.1