diff options
author | Wei-Han Chen <stimim@google.com> | 2018-07-06 15:38:17 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-08-31 11:19:47 -0700 |
commit | ee67f4f6c77e9fcda040437c805108820e4e3f5d (patch) | |
tree | 3ec9a7f86a3e689e8d9e03aa6a0e7fe4df9a6101 /chip | |
parent | 83ee439d07468b4e4a196b81da665c06f3c779a1 (diff) | |
download | chrome-ec-ee67f4f6c77e9fcda040437c805108820e4e3f5d.tar.gz |
stm32: usb_hid_touchpad: add 'device capabilities' report
'device capabilities' report is expected by precision touchpad driver.
BRANCH=none
BUG=b:70482333
TEST=manual
Signed-off-by: Wei-Han Chen <stimim@chromium.org>
Change-Id: I8801f219cc76021f3519f0371f38bdc731dec287
Reviewed-on: https://chromium-review.googlesource.com/1188173
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')
-rw-r--r-- | chip/stm32/usb_hid_touchpad.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/chip/stm32/usb_hid_touchpad.c b/chip/stm32/usb_hid_touchpad.c index 6a658ce66d..1d835926bc 100644 --- a/chip/stm32/usb_hid_touchpad.c +++ b/chip/stm32/usb_hid_touchpad.c @@ -166,9 +166,26 @@ static const uint8_t report_desc[] = { 0x95, 0x01, /* Report Count (1) */ 0x09, 0x56, /* Usage (0x56, Relative Scan Time) */ 0x81, 0x02, /* Input (Data,Var,Abs) */ + + 0x85, REPORT_ID_DEVICE_CAPS, /* Report ID (Device Capabilities) */ + 0x09, 0x55, /* Usage (Contact Count Maximum) */ + 0x09, 0x59, /* Usage (Pad Type) */ + 0x25, 0x0F, /* Logical Maximum (15) */ + 0x75, 0x08, /* Report Size (8) */ + 0x95, 0x01, /* Report Count (2) */ + 0xB1, 0x02, /* Feature (Data,Var,Abs) */ + 0xC0, /* End Collection */ }; +/* Device capabilities feature report. */ +static const uint8_t device_caps_response[] = { + REPORT_ID_DEVICE_CAPS, + + MAX_FINGERS, /* Contact Count Maximum */ + 0x00, /* Pad Type: Depressible click-pad */ +}; + const struct usb_hid_descriptor USB_CUSTOM_DESC_VAR(USB_IFACE_HID_TOUCHPAD, hid, hid_desc_tp) = { .bLength = 9, @@ -328,6 +345,12 @@ static int get_report(uint8_t report_id, uint8_t report_type, const uint8_t **buffer_ptr, int *buffer_size) { + switch (report_id) { + case REPORT_ID_DEVICE_CAPS: + *buffer_ptr = device_caps_response; + *buffer_size = MIN(sizeof(device_caps_response), *buffer_size); + return 0; + } return -1; } |