summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei-Han Chen <stimim@google.com>2018-11-15 18:03:53 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-11-19 11:22:19 -0800
commit65b8dcf6da612c774d372c3c29e16923d7f6f379 (patch)
tree37763cc5e803100bedeecbe02c2fc1e2477afae7
parente7a79b77558d45de9264e5b3ddcf926d7ea7e321 (diff)
downloadchrome-ec-65b8dcf6da612c774d372c3c29e16923d7f6f379.tar.gz
touchpad_st: do not generate 0 finger hid event
When we receive a beacon, we will also try to collect finger events. In this case, there might be the case that there is not finger but dome switch is on. In this case, we should not report the click. BRANCH=nocturne BUG=b:119597909 TEST=manual on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I03fe4481d17f6e919ab9501b2a93fa19635e381f Reviewed-on: https://chromium-review.googlesource.com/1337253 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r--driver/touchpad_st.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c
index 57c25a5181..d4ba6e7d5b 100644
--- a/driver/touchpad_st.c
+++ b/driver/touchpad_st.c
@@ -298,7 +298,9 @@ static int st_tp_write_hid_report(void)
if (!num_finger && !domeswitch_changed) /* nothing changed */
return 0;
- report.button = !!(system_state & SYSTEM_STATE_DOME_SWITCH_LEVEL);
+ /* Don't report 0 finger click. */
+ if (num_finger && (system_state & SYSTEM_STATE_DOME_SWITCH_LEVEL))
+ report.button = 1;
report.count = num_finger;
report.timestamp = irq_ts / USB_HID_TOUCHPAD_TIMESTAMP_UNIT;