summaryrefslogtreecommitdiff
path: root/chip/stm32/usb_hid_touchpad.c
diff options
context:
space:
mode:
authorWei-Han Chen <stimim@google.com>2018-07-17 19:50:28 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-08-03 01:31:18 -0700
commitd2341b237f750b1b5daf7e92fb47e12d3316f7ec (patch)
tree753435c4968ea1e47a455d884c0e6d926f8c8426 /chip/stm32/usb_hid_touchpad.c
parent535c4d4a6a0e1c669ddee3c81b45faa22ac27196 (diff)
downloadchrome-ec-d2341b237f750b1b5daf7e92fb47e12d3316f7ec.tar.gz
usb_hid_touchpad: make max pressure configurable
Maximum pressure is now defined by CONFIG_USB_HID_TOUCHPAD_LOGICAL_MAX_Z. `hammer` is the only board using usb_hid_touchpad, the board.h is updated to reflect the change (for old boards "HAMMER" and "STAFF", we keep the value 1023, so they should behave the same). BRANCH=none BUG=b:70482333 TEST=make BOARD=whiskers TEST=make buildall -j TEST=manually on device Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I70b0a5b19dfbe3ac731ef2ead08578a7f7a1cb0b Reviewed-on: https://chromium-review.googlesource.com/1141676 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'chip/stm32/usb_hid_touchpad.c')
-rw-r--r--chip/stm32/usb_hid_touchpad.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/chip/stm32/usb_hid_touchpad.c b/chip/stm32/usb_hid_touchpad.c
index 6646ad2e09..06082fdb1f 100644
--- a/chip/stm32/usb_hid_touchpad.c
+++ b/chip/stm32/usb_hid_touchpad.c
@@ -82,7 +82,9 @@ const struct usb_endpoint_descriptor USB_EP_DESC(USB_IFACE_HID_TOUCHPAD, 81) = {
0x25, 0x0F, /* Logical Maximum (15) */ \
0x81, 0x02, /* Input (Data,Var,Abs) */ \
0x05, 0x0D, /* Usage Page (Digitizer) */ \
- 0x26, 0xFF, 0x03, /* Logical Maximum (1023) */ \
+ /* Logical Maximum of Pressure */ \
+ 0x26, (CONFIG_USB_HID_TOUCHPAD_LOGICAL_MAX_PRESSURE & 0xFF), \
+ (CONFIG_USB_HID_TOUCHPAD_LOGICAL_MAX_PRESSURE >> 8), \
0x75, 0x0A, /* Report Size (10) */ \
0x09, 0x30, /* Usage (Tip pressure) */ \
0x81, 0x02, /* Input (Data,Var,Abs) */ \