Skip to content

Commit 17b9292

Browse files
committed
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 <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 904e782 commit 17b9292

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

drivers/input/touchscreen/edt-ft5x06.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
229229

230230
for (i = 0; i < tsdata->max_support_points; i++) {
231231
u8 *buf = &rdbuf[i * tplen + offset];
232-
bool down;
233232

234233
type = buf[0] >> 6;
235234
/* ignore Reserved events */
@@ -247,16 +246,12 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
247246
swap(x, y);
248247

249248
id = (buf[2] >> 4) & 0x0f;
250-
down = type != TOUCH_EVENT_UP;
251249

252250
input_mt_slot(tsdata->input, id);
253-
input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER, down);
254-
255-
if (!down)
256-
continue;
257-
258-
touchscreen_report_pos(tsdata->input, &tsdata->prop, x, y,
259-
true);
251+
if (input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER,
252+
type != TOUCH_EVENT_UP))
253+
touchscreen_report_pos(tsdata->input, &tsdata->prop,
254+
x, y, true);
260255
}
261256

262257
input_mt_report_pointer_emulation(tsdata->input, true);

0 commit comments

Comments
 (0)