diff options
author | Wei-Han Chen <stimim@google.com> | 2018-11-15 18:03:53 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-11-19 11:22:19 -0800 |
commit | 65b8dcf6da612c774d372c3c29e16923d7f6f379 (patch) | |
tree | 37763cc5e803100bedeecbe02c2fc1e2477afae7 /driver | |
parent | e7a79b77558d45de9264e5b3ddcf926d7ea7e321 (diff) | |
download | chrome-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>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/touchpad_st.c | 4 |
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; |