summaryrefslogtreecommitdiff
path: root/driver/touchpad_st.c
diff options
context:
space:
mode:
authorWei-Han Chen <stimim@google.com>2018-09-28 15:16:08 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-09-28 10:10:57 -0700
commit64c792829c2fd6bda4985e2add424cce41c5cfd9 (patch)
treef0f4fe366ea0c329001d6c97635f4b119699dac5 /driver/touchpad_st.c
parentacfd14a3345e7b7fa3fd3520c5b399fe6229d3cc (diff)
downloadchrome-ec-64c792829c2fd6bda4985e2add424cce41c5cfd9.tar.gz
usb_hid_touchpad: set confidence bit on finger leave
When finger is leaving, the confidence should be '1', since it is not a plam. Some background: Since CL:617811, Linux kernel treats a finger whose confidence equal to 0 as a "palm", and override its width and height with max value. Therefore, when we are reporting a finger leaving event, if the confidence is 0, the finger will quickly become a fat finger (max width and heigh, locates at top-left corner), and then leave. This will confuse gesture library, and might cause unintended behaviors. BRANCH=nocturne BUG=b:116321493 TEST=manually on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I30be0e5efeb6c2215795565dce8c2da23892939f Reviewed-on: https://chromium-review.googlesource.com/1250584 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Tai-Hsu Lin <sheckylin@chromium.org>
Diffstat (limited to 'driver/touchpad_st.c')
-rw-r--r--driver/touchpad_st.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c
index cde1a07edb..c445f1dbf5 100644
--- a/driver/touchpad_st.c
+++ b/driver/touchpad_st.c
@@ -205,6 +205,8 @@ static int st_tp_parse_finger(struct usb_hid_touchpad_report *report,
break;
case ST_TP_EVENT_ID_LEAVE_POINTER:
report->finger[i].id = event->finger.touch_id;
+ /* When a finger is leaving, it's not a palm */
+ report->finger[i].confidence = 1;
break;
}
return i + 1;