summaryrefslogtreecommitdiff
path: root/driver/touchpad_st.c
diff options
context:
space:
mode:
authorWei-Han Chen <stimim@google.com>2018-07-06 15:33:25 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-08-31 11:19:46 -0700
commitb9841cfcdf7404c868ea9967217cf750820b9491 (patch)
tree61b73835164699c6bc44eb00c11f0bf2f9697537 /driver/touchpad_st.c
parent9bb5117aa350e21f6c15257d7d7a464af4b6d08c (diff)
downloadchrome-ec-b9841cfcdf7404c868ea9967217cf750820b9491.tar.gz
stm32: usb_hid_touchpad: add confidence
`confidence` is expected from a PTP-compliant touchpad BRANCH=none BUG=b:70482333 TEST=manual Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: Ibe7166f43cae5fb36bbcc4e6dfd9ae6525a7225e Reviewed-on: https://chromium-review.googlesource.com/1188170 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'driver/touchpad_st.c')
-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 11a85a90c8..1a4835125f 100644
--- a/driver/touchpad_st.c
+++ b/driver/touchpad_st.c
@@ -164,6 +164,8 @@ static int st_tp_parse_finger(struct usb_hid_touchpad_report *report,
switch (event->evt_id) {
case ST_TP_EVENT_ID_ENTER_POINTER:
case ST_TP_EVENT_ID_MOTION_POINTER:
+ /* Pressure == 255 is a palm. */
+ report->finger[i].confidence = (event->finger.z < 255);
report->finger[i].tip = 1;
report->finger[i].inrange = 1;
report->finger[i].id = event->finger.touch_id;
@@ -230,7 +232,7 @@ static int st_tp_write_hid_report(void)
return -num_events;
memset(&report, 0, sizeof(report));
- report.id = 0x1;
+ report.id = REPORT_ID_TOUCHPAD;
num_finger = 0;
for (i = 0; i < num_events; i++) {