Skip to content

Commit 9fa9687

Browse files
xNombreonettboots
authored andcommitted
input: goodix: Don't memset touch_data
Touch_data is read by goodix_ts_input_report() as long as id is matching with counter. We can assume that id = 0 indicates end of data. This means zeroing touch_data can be removed completely and replaced with a simple zero assignment onto the next id in data package. Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com> Signed-off-by: onettboots <blackcocopet@gmail.com>
1 parent 0cb8741 commit 9fa9687

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/input/touchscreen/goodix_driver_gt9886/goodix_ts_i2c.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,10 +1796,6 @@ static int goodix_touch_handler(struct goodix_ts_device *dev,
17961796
2 + BYTES_PER_COORD * max_touch_num,
17971797
touch_num);
17981798

1799-
1800-
/*clear buffer*/
1801-
memset(touch_data->coords, 0x00, sizeof(touch_data->coords));
1802-
18031799
if (likely(touch_num >= 1)) {
18041800
/*"0 ~ touch_num - 2" is finger, "touch_num - 1" may be a finger or a pen*/
18051801
/*process "0 ~ touch_num -2"*/
@@ -1816,6 +1812,10 @@ static int goodix_touch_handler(struct goodix_ts_device *dev,
18161812
coords->area = buffer[i * BYTES_PER_COORD + 9];
18171813
coords++;
18181814
}
1815+
if (likely(i < max_touch_num)) {
1816+
// Report data end
1817+
coords->id = 0;
1818+
}
18191819
}
18201820

18211821
/*swap coord*/

0 commit comments

Comments
 (0)