input: touchscreen: ft5x06: remove unbalanced touch event
Touchscreen driver may generate unbalanced input events when
enter suspend state, these unbalanced event will make input
system always wait for symmetrical input event and can not
handle input event properly. PRESSURE event is removed to
keep input events symmetrical.
CRs-Fixed: 566134
Change-Id: I3f6fda3fb5d0a717ae943a9113be89623c96ce61
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
diff --git a/drivers/input/touchscreen/ft5x06_ts.c b/drivers/input/touchscreen/ft5x06_ts.c
index aa50d44..ef76e69 100644
--- a/drivers/input/touchscreen/ft5x06_ts.c
+++ b/drivers/input/touchscreen/ft5x06_ts.c
@@ -288,7 +288,7 @@
struct ft5x06_ts_data *data = dev_id;
struct input_dev *ip_dev;
int rc, i;
- u32 id, x, y, pressure, status, num_touches;
+ u32 id, x, y, status, num_touches;
u8 reg = 0x00, *buf;
bool update_input = false;
@@ -329,11 +329,9 @@
input_mt_slot(ip_dev, id);
if (status == FT_TOUCH_DOWN || status == FT_TOUCH_CONTACT) {
- pressure = FT_PRESS;
input_mt_report_slot_state(ip_dev, MT_TOOL_FINGER, 1);
input_report_abs(ip_dev, ABS_MT_POSITION_X, x);
input_report_abs(ip_dev, ABS_MT_POSITION_Y, y);
- input_report_abs(ip_dev, ABS_MT_PRESSURE, pressure);
} else {
input_mt_report_slot_state(ip_dev, MT_TOOL_FINGER, 0);
}
@@ -479,7 +477,7 @@
input_mt_slot(data->input_dev, i);
input_mt_report_slot_state(data->input_dev, MT_TOOL_FINGER, 0);
}
- input_report_key(data->input_dev, BTN_TOUCH, 0);
+ input_mt_report_pointer_emulation(data->input_dev, false);
input_sync(data->input_dev);
if (gpio_is_valid(data->pdata->reset_gpio)) {
@@ -1369,7 +1367,6 @@
pdata->x_max, 0, 0);
input_set_abs_params(input_dev, ABS_MT_POSITION_Y, pdata->y_min,
pdata->y_max, 0, 0);
- input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, FT_PRESS, 0, 0);
err = input_register_device(input_dev);
if (err) {