]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.157/input-atmel_mxt_ts-only-use-first-t9-instance.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.157 / input-atmel_mxt_ts-only-use-first-t9-instance.patch
1 From foo@baz Mon Sep 17 12:15:09 CEST 2018
2 From: Nick Dyer <nick.dyer@itdev.co.uk>
3 Date: Fri, 27 Jul 2018 11:44:20 -0700
4 Subject: Input: atmel_mxt_ts - only use first T9 instance
5
6 From: Nick Dyer <nick.dyer@itdev.co.uk>
7
8 [ Upstream commit 36f5d9ef26e52edff046b4b097855db89bf0cd4a ]
9
10 The driver only registers one input device, which uses the screen
11 parameters from the first T9 instance. The first T63 instance also uses
12 those parameters.
13
14 It is incorrect to send input reports from the second instances of these
15 objects if they are enabled: the input scaling will be wrong and the
16 positions will be mashed together.
17
18 This also causes problems on Android if the number of slots exceeds 32.
19
20 In the future, this could be handled by looking for enabled touch object
21 instances and creating an input device for each one.
22
23 Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
24 Acked-by: Benson Leung <bleung@chromium.org>
25 Acked-by: Yufeng Shen <miletus@chromium.org>
26 Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
27 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
28 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 ---
30 drivers/input/touchscreen/atmel_mxt_ts.c | 7 ++++---
31 1 file changed, 4 insertions(+), 3 deletions(-)
32
33 --- a/drivers/input/touchscreen/atmel_mxt_ts.c
34 +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
35 @@ -1593,10 +1593,11 @@ static int mxt_get_object_table(struct m
36 break;
37 case MXT_TOUCH_MULTI_T9:
38 data->multitouch = MXT_TOUCH_MULTI_T9;
39 + /* Only handle messages from first T9 instance */
40 data->T9_reportid_min = min_id;
41 - data->T9_reportid_max = max_id;
42 - data->num_touchids = object->num_report_ids
43 - * mxt_obj_instances(object);
44 + data->T9_reportid_max = min_id +
45 + object->num_report_ids - 1;
46 + data->num_touchids = object->num_report_ids;
47 break;
48 case MXT_SPT_MESSAGECOUNT_T44:
49 data->T44_address = object->start_address;