summaryrefslogtreecommitdiff
path: root/driver/touchpad_elan.c
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-07-22 06:34:10 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-07-31 07:38:06 -0700
commit043c55026242d0b485a400f0ac4020d373e19673 (patch)
treec2a0746d05783dc1436a96cbb1f8c30948a22cd0 /driver/touchpad_elan.c
parentcb06c593b401b8879d8c89e38863789c7385af98 (diff)
downloadchrome-ec-043c55026242d0b485a400f0ac4020d373e19673.tar.gz
chip/stm32/usb_hid_touchpad: Widen pressure field to 10 bits
id only really needs 4 bits (16 touch events should be more than enough), so we can steal 2 bits from that field. We also reorder the fields to make sure that width/x are aligned on 8-bit boundary. BRANCH=none BUG=b:63936194 TEST=Flash hammer, touchpad works, ABS_PRESSURE > 255 is reported when a palm is pressed on the touchpad. Change-Id: I1abf1bf53cc9dd998082cea5dc7cd3be17f99ec6 Reviewed-on: https://chromium-review.googlesource.com/583297 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Chun-ta Lin <itspeter@chromium.org> Reviewed-by: KT Liao <kt.liao@emc.com.tw>
Diffstat (limited to 'driver/touchpad_elan.c')
-rw-r--r--driver/touchpad_elan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/touchpad_elan.c b/driver/touchpad_elan.c
index f0d3e6c9c1..3c8d5abeae 100644
--- a/driver/touchpad_elan.c
+++ b/driver/touchpad_elan.c
@@ -156,7 +156,7 @@ static int elan_tp_read_report(void)
width = MIN(4095, width * elan_tp_params.width_x);
height = MIN(4095, height * elan_tp_params.width_y);
- pressure = MIN(255, pressure);
+ pressure = MIN(1023, pressure);
report.finger[ri].tip = 1;
report.finger[ri].inrange = 1;