From 5a5e390ea943edadd0c711cbb259abeba22aa364 Mon Sep 17 00:00:00 2001 From: zhanghao Date: Fri, 3 Feb 2012 17:43:15 +0800 Subject: [PATCH] pixcir driver : filter 2 pixels change in report --- drivers/input/touchscreen/pixcir_i2c_ts.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c index 57b83fd99f02..39faff42b374 100644 --- a/drivers/input/touchscreen/pixcir_i2c_ts.c +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c @@ -70,13 +70,14 @@ struct point_data{ unsigned char id; //finger ID int posx; int posy; + int lastx; + int lasty; unsigned char active; unsigned char pre_active; }; static struct point_data point[MAX_SUPPORT_POINT]; - struct i2c_dev { struct list_head list; @@ -272,12 +273,17 @@ static void pixcir_ts_poscheck(struct pixcir_i2c_ts_data *data) input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER, false); } - if (point[i].active) { + if (point[i].active && ( + abs(point[i].posx - point[i].lastx) > 2 || + abs(point[i].posy - point[i].lasty) > 2 + )) { input_mt_slot(tsdata->input, point[i].id); input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER, true); input_report_abs(tsdata->input, ABS_MT_TOUCH_MAJOR, 1); input_report_abs(tsdata->input, ABS_MT_POSITION_X, point[i].posy); input_report_abs(tsdata->input, ABS_MT_POSITION_Y, point[i].posx); + point[i].lastx = point[i].posx; + point[i].lasty = point[i].posy; } DBG("%d[id = %d] = %2d active= %d pre_active = %d x = %5d y = %5d \n", -- 2.34.1