diff options
author | Wei-Han Chen <stimim@google.com> | 2018-09-19 15:12:53 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-09-26 10:32:06 -0700 |
commit | 63dd0de36d4ca7148a3c775ffb59c7eff610cf93 (patch) | |
tree | 051b712ff3331716f01bc37a47d97ff757263a9c /driver/touchpad_st.c | |
parent | 8649d800a9dd9c23de199029b2db25827f687925 (diff) | |
download | chrome-ec-63dd0de36d4ca7148a3c775ffb59c7eff610cf93.tar.gz |
usb_hid_touchpad: fix logical max of width & height
Width and Height are 12 bits in USB HID descriptor. But the logical
maximum was set to 255.
Also scale up width and height reported by ST firmware.
BRANCH=nocturne
BUG=none
TEST=manual on whiskers
Signed-off-by: Wei-Han Chen <stimim@chromium.org>
Change-Id: I899af2b18120d9e877d45e1dc2c14404a412797b
Reviewed-on: https://chromium-review.googlesource.com/1232798
Reviewed-by: Tai-Hsu Lin <sheckylin@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'driver/touchpad_st.c')
-rw-r--r-- | driver/touchpad_st.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c index 9704e8c0ac..be6628815a 100644 --- a/driver/touchpad_st.c +++ b/driver/touchpad_st.c @@ -191,9 +191,10 @@ static int st_tp_parse_finger(struct usb_hid_touchpad_report *report, report->finger[i].id = event->finger.touch_id; report->finger[i].pressure = event->finger.z; report->finger[i].width = (event->finger.minor | - (event->minor_high << 4)); + (event->minor_high << 4)) << 4; report->finger[i].height = (event->finger.major | - (event->major_high << 4)); + (event->major_high << 4)) << 4; + report->finger[i].x = (CONFIG_USB_HID_TOUCHPAD_LOGICAL_MAX_X - event->finger.x); report->finger[i].y = (CONFIG_USB_HID_TOUCHPAD_LOGICAL_MAX_Y - |