Skip to content
Snippets Groups Projects
Commit 5517bf25 authored by Clemens Terasa's avatar Clemens Terasa Committed by Jonas Höppner
Browse files

SIS: Fix touch-up issue

Sometimes we get no touchup signal in Qt.
This was seen with the QML drag-and-drop example.

Looking at the output of evtest of the sis input device, you see
different behavior for a working and a missing touch-up.

Failed:
<pre>
...
Event: time 1587646331.383580, type 3 (EV_ABS), code 0 (ABS_X), value 2365
Event: time 1587646331.383580, type 3 (EV_ABS), code 1 (ABS_Y), value 2894
Event: time 1587646331.383580, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 2365
Event: time 1587646331.383580, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 2894
Event: time 1587646331.383580, -------------- SYN_REPORT ------------
Event: time 1587646331.402073, type 3 (EV_ABS), code 0 (ABS_X), value 2367
Event: time 1587646331.402073, type 3 (EV_ABS), code 1 (ABS_Y), value 2887
Event: time 1587646331.402073, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0
Event: time 1587646331.402073, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 0
Event: time 1587646331.402073, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 2367
Event: time 1587646331.402073, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 2887
Event: time 1587646331.402073, -------------- SYN_REPORT ------------
</pre>

Good
<pre>
Event: time 1587646407.907930, -------------- SYN_REPORT ------------
Event: time 1587646407.922769, type 3 (EV_ABS), code 0 (ABS_X), value 790
Event: time 1587646407.922769, type 3 (EV_ABS), code 1 (ABS_Y), value 1747
Event: time 1587646407.922769, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 790
Event: time 1587646407.922769, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1747
Event: time 1587646407.922769, -------------- SYN_REPORT ------------
Event: time 1587646407.945577, type 3 (EV_ABS), code 0 (ABS_X), value 840
Event: time 1587646407.945577, type 3 (EV_ABS), code 1 (ABS_Y), value 1918
Event: time 1587646407.945577, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 840
Event: time 1587646407.945577, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1918
Event: time 1587646407.945577, -------------- SYN_REPORT ------------
Event: time 1587646407.968810, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0
Event: time 1587646407.968810, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 0
Event: time 1587646407.968810, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 1587646407.968810, -------------- SYN_REPORT ------------
</pre>

It seems that the @ABS_MT_TRACKING_ID value -1@ is missing somehow.

This might be the case when the driver sends a valid coodinate but also
states that the pressure is 0.

Fix this by sending a touch-up (all ABS_PRESSUE, ABS_MT_PRESSURE, and
ABS_BUTTON 0 and ABS_MT_TRACKING_ID -1) when pressure is 0.

BCS 746-000871

(cherry picked from commit 0326de4b)
parent 034d5b83
No related branches found
No related tags found
1 merge request!249Pull changes from dunfell branch
......@@ -388,7 +388,7 @@ static irqreturn_t sis_ts_irq_handler(int irq, void *dev_id)
type_b_report:
for (i = 0; i < MAX_FINGERS; i++) {
if (check_id[i] == 1) {
if (check_id[i]) {
if( i == 0){
input_report_abs(ts->input_dev,
BTN_TOUCH, 1);
......@@ -409,7 +409,9 @@ type_b_report:
ABS_MT_POSITION_X, sisdata[i].x);
input_report_abs(ts->input_dev,
ABS_MT_POSITION_Y, sisdata[i].y);
} else if (pre_check_id[i] == 1) { // Was pressed last time, but not anymode -> send a release
}
if ((!check_id[i] && pre_check_id[i]) || // Was pressed last time, but not anymode -> send a release
sisdata[i].pressure == 0) {
if( i == 0){
input_report_abs(ts->input_dev,
BTN_TOUCH, 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment