From 63dd0de36d4ca7148a3c775ffb59c7eff610cf93 Mon Sep 17 00:00:00 2001 From: Wei-Han Chen Date: Wed, 19 Sep 2018 15:12:53 +0800 Subject: 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 Change-Id: I899af2b18120d9e877d45e1dc2c14404a412797b Reviewed-on: https://chromium-review.googlesource.com/1232798 Reviewed-by: Tai-Hsu Lin Reviewed-by: Nicolas Boichat --- driver/touchpad_st.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'driver/touchpad_st.c') 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 - -- cgit v1.2.1