aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2019-06-23 02:21:24 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2019-07-05 13:19:13 -0400
commit17b92927f8531d1ceb7e4f10b75fc4b066ac77fc (patch)
tree8f7636b183a1196773934bcd5f5ff8f6d9c99e86
parent904e782b07df1c685fdc8c4fc8d62e1d61f9ee32 (diff)
Input: edt-ft5x06 - simplify event reporting code
Now that input_mt_report_slot_state() returns true if slot is active we no longer need a temporary for the slot state. Tested-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/touchscreen/edt-ft5x06.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index ec770226e119..3cc4341bbdff 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -229,7 +229,6 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
229 229
230 for (i = 0; i < tsdata->max_support_points; i++) { 230 for (i = 0; i < tsdata->max_support_points; i++) {
231 u8 *buf = &rdbuf[i * tplen + offset]; 231 u8 *buf = &rdbuf[i * tplen + offset];
232 bool down;
233 232
234 type = buf[0] >> 6; 233 type = buf[0] >> 6;
235 /* ignore Reserved events */ 234 /* ignore Reserved events */
@@ -247,16 +246,12 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
247 swap(x, y); 246 swap(x, y);
248 247
249 id = (buf[2] >> 4) & 0x0f; 248 id = (buf[2] >> 4) & 0x0f;
250 down = type != TOUCH_EVENT_UP;
251 249
252 input_mt_slot(tsdata->input, id); 250 input_mt_slot(tsdata->input, id);
253 input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER, down); 251 if (input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER,
254 252 type != TOUCH_EVENT_UP))
255 if (!down) 253 touchscreen_report_pos(tsdata->input, &tsdata->prop,
256 continue; 254 x, y, true);
257
258 touchscreen_report_pos(tsdata->input, &tsdata->prop, x, y,
259 true);
260 } 255 }
261 256
262 input_mt_report_pointer_emulation(tsdata->input, true); 257 input_mt_report_pointer_emulation(tsdata->input, true);