From 65b8dcf6da612c774d372c3c29e16923d7f6f379 Mon Sep 17 00:00:00 2001 From: Wei-Han Chen Date: Thu, 15 Nov 2018 18:03:53 +0800 Subject: 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 Change-Id: I03fe4481d17f6e919ab9501b2a93fa19635e381f Reviewed-on: https://chromium-review.googlesource.com/1337253 Commit-Ready: Wei-Han Chen Tested-by: Wei-Han Chen Reviewed-by: Nicolas Boichat --- driver/touchpad_st.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- cgit v1.2.1