summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFigo Wang <figow@codeaurora.org>2013-06-28 19:49:49 +0800
committerAbinaya P <abinayap@codeaurora.org>2016-08-17 15:58:56 +0530
commit849d4f3c1c389abc019511467a48594ba82298bc (patch)
tree006a09f767abeec84ed66987e2b9941eaeb16b7e
parentc72652e02fc4a7ea084810d37918ae6331542ea0 (diff)
input: touchpanel: Release all touches during suspend
Release all the touches before going to suspend to avoid sticky touches and correct multitouch ID error. This patch is propagated from 3.18 kernel 'commit 8a123ff1f64b ("input: touchpanel: Release all touches during suspend")' Change-Id: I5dd84d44478291e16fd577aad5cf06503e44fbde Signed-off-by: Figo Wang <figow@codeaurora.org>
-rw-r--r--drivers/input/touchscreen/ft5x06_ts.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/input/touchscreen/ft5x06_ts.c b/drivers/input/touchscreen/ft5x06_ts.c
index 8e4d146186f7..53d66b2ac924 100644
--- a/drivers/input/touchscreen/ft5x06_ts.c
+++ b/drivers/input/touchscreen/ft5x06_ts.c
@@ -308,7 +308,7 @@ static void ft5x06_report_value(struct ft5x06_ts_data *data)
event->pressure = 0;
}
- input_mt_slot(data->input_dev, i);
+ input_mt_slot(data->input_dev, event->finger_id[i]);
input_mt_report_slot_state(data->input_dev, MT_TOOL_FINGER,
!!event->pressure);
@@ -317,10 +317,6 @@ static void ft5x06_report_value(struct ft5x06_ts_data *data)
event->x[i]);
input_report_abs(data->input_dev, ABS_MT_POSITION_Y,
event->y[i]);
- input_report_abs(data->input_dev, ABS_MT_PRESSURE,
- event->pressure);
- input_report_abs(data->input_dev, ABS_MT_TRACKING_ID,
- event->finger_id[i]);
input_report_abs(data->input_dev, ABS_MT_TOUCH_MAJOR,
event->pressure);
}
@@ -494,7 +490,7 @@ pwr_deinit:
static int ft5x06_ts_suspend(struct device *dev)
{
struct ft5x06_ts_data *data = dev_get_drvdata(dev);
- char txbuf[2];
+ char txbuf[2], i;
if (data->loading_fw) {
dev_info(dev, "Firmware loading in process...\n");
@@ -508,6 +504,14 @@ static int ft5x06_ts_suspend(struct device *dev)
disable_irq(data->client->irq);
+ /* release all touches */
+ for (i = 0; i < CFG_MAX_TOUCH_POINTS; i++) {
+ 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_sync(data->input_dev);
+
if (gpio_is_valid(data->pdata->reset_gpio)) {
txbuf[0] = FT_REG_PMODE;
txbuf[1] = FT_PMODE_HIBERNATE;
@@ -1230,7 +1234,6 @@ static int ft5x06_ts_probe(struct i2c_client *client,
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_TOUCH_MAJOR, 0, FT_PRESS, 0, 0);
- input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, FT_PRESS, 0, 0);
err = input_register_device(input_dev);
if (err) {