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.

This patch is propagated from msm-3.18 kernel
'commit 15725c248511 ("input: touchscreen: ft5x06: remove
unbalanced touch event")'

CRs-Fixed: 566134
Change-Id: I3f6fda3fb5d0a717ae943a9113be89623c96ce61
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
This commit is contained in:
Bingzhe Cai 2013-10-25 00:28:21 +08:00 committed by Abinaya P
parent 8ac5a9e361
commit 0530539198

View file

@ -288,7 +288,7 @@ static irqreturn_t ft5x06_ts_interrupt(int irq, void *dev_id)
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 @@ static irqreturn_t ft5x06_ts_interrupt(int irq, void *dev_id)
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 @@ static int ft5x06_ts_suspend(struct device *dev)
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)) {
@ -1365,7 +1363,6 @@ static int ft5x06_ts_probe(struct i2c_client *client,
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) {