summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorWei-Han Chen <stimim@google.com>2018-07-06 15:39:54 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-08-31 11:19:47 -0700
commit3303cf3d0427555beae12d4bb1af37303dfbabef (patch)
tree312b9c1f16d2af87e996600d596480cd5f45e341 /chip
parentee67f4f6c77e9fcda040437c805108820e4e3f5d (diff)
downloadchrome-ec-3303cf3d0427555beae12d4bb1af37303dfbabef.tar.gz
stm32: usb_hid_touchpad: add 'device certification status' report
'device certification status' is expected by Precision Touchpad driver. BRANCH=none BUG=b:70482333 TEST=manual Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: Ie71208e309378bbd604160f68a8313331a6d5308 Reviewed-on: https://chromium-review.googlesource.com/1188174 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.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/chip/stm32/usb_hid_touchpad.c b/chip/stm32/usb_hid_touchpad.c
index 1d835926bc..1c301a04a1 100644
--- a/chip/stm32/usb_hid_touchpad.c
+++ b/chip/stm32/usb_hid_touchpad.c
@@ -175,9 +175,60 @@ static const uint8_t report_desc[] = {
0x95, 0x01, /* Report Count (2) */
0xB1, 0x02, /* Feature (Data,Var,Abs) */
+ /* Page 0xFF, usage 0xC5 is device certificate. */
+ 0x06, 0x00, 0xFF, /* Usage Page (Vendor Defined) */
+ 0x85, REPORT_ID_DEVICE_CERT, /* Report ID (Device Certification) */
+ 0x09, 0xC5, /* Usage (Vendor Usage 0xC5) */
+ 0x15, 0x00, /* Logical Minimum (0) */
+ 0x26, 0xFF, 0x00, /* Logical Maximum (255) */
+ 0x75, 0x08, /* Report Size (8) */
+ 0x96, 0x00, 0x01, /* Report Count (256) */
+ 0xB1, 0x02, /* Feature (Data,Var,Abs) */
+
0xC0, /* End Collection */
};
+/* A 256-byte default blob for the 'device certification status' feature report.
+ *
+ * TODO(b/113248108): do we need a real certification?
+ */
+static const uint8_t device_cert_response[] = {
+ REPORT_ID_DEVICE_CERT,
+
+ 0xFC, 0x28, 0xFE, 0x84, 0x40, 0xCB, 0x9A, 0x87,
+ 0x0D, 0xBE, 0x57, 0x3C, 0xB6, 0x70, 0x09, 0x88,
+ 0x07, 0x97, 0x2D, 0x2B, 0xE3, 0x38, 0x34, 0xB6,
+ 0x6C, 0xED, 0xB0, 0xF7, 0xE5, 0x9C, 0xF6, 0xC2,
+ 0x2E, 0x84, 0x1B, 0xE8, 0xB4, 0x51, 0x78, 0x43,
+ 0x1F, 0x28, 0x4B, 0x7C, 0x2D, 0x53, 0xAF, 0xFC,
+ 0x47, 0x70, 0x1B, 0x59, 0x6F, 0x74, 0x43, 0xC4,
+ 0xF3, 0x47, 0x18, 0x53, 0x1A, 0xA2, 0xA1, 0x71,
+ 0xC7, 0x95, 0x0E, 0x31, 0x55, 0x21, 0xD3, 0xB5,
+ 0x1E, 0xE9, 0x0C, 0xBA, 0xEC, 0xB8, 0x89, 0x19,
+ 0x3E, 0xB3, 0xAF, 0x75, 0x81, 0x9D, 0x53, 0xB9,
+ 0x41, 0x57, 0xF4, 0x6D, 0x39, 0x25, 0x29, 0x7C,
+ 0x87, 0xD9, 0xB4, 0x98, 0x45, 0x7D, 0xA7, 0x26,
+ 0x9C, 0x65, 0x3B, 0x85, 0x68, 0x89, 0xD7, 0x3B,
+ 0xBD, 0xFF, 0x14, 0x67, 0xF2, 0x2B, 0xF0, 0x2A,
+ 0x41, 0x54, 0xF0, 0xFD, 0x2C, 0x66, 0x7C, 0xF8,
+ 0xC0, 0x8F, 0x33, 0x13, 0x03, 0xF1, 0xD3, 0xC1,
+ 0x0B, 0x89, 0xD9, 0x1B, 0x62, 0xCD, 0x51, 0xB7,
+ 0x80, 0xB8, 0xAF, 0x3A, 0x10, 0xC1, 0x8A, 0x5B,
+ 0xE8, 0x8A, 0x56, 0xF0, 0x8C, 0xAA, 0xFA, 0x35,
+ 0xE9, 0x42, 0xC4, 0xD8, 0x55, 0xC3, 0x38, 0xCC,
+ 0x2B, 0x53, 0x5C, 0x69, 0x52, 0xD5, 0xC8, 0x73,
+ 0x02, 0x38, 0x7C, 0x73, 0xB6, 0x41, 0xE7, 0xFF,
+ 0x05, 0xD8, 0x2B, 0x79, 0x9A, 0xE2, 0x34, 0x60,
+ 0x8F, 0xA3, 0x32, 0x1F, 0x09, 0x78, 0x62, 0xBC,
+ 0x80, 0xE3, 0x0F, 0xBD, 0x65, 0x20, 0x08, 0x13,
+ 0xC1, 0xE2, 0xEE, 0x53, 0x2D, 0x86, 0x7E, 0xA7,
+ 0x5A, 0xC5, 0xD3, 0x7D, 0x98, 0xBE, 0x31, 0x48,
+ 0x1F, 0xFB, 0xDA, 0xAF, 0xA2, 0xA8, 0x6A, 0x89,
+ 0xD6, 0xBF, 0xF2, 0xD3, 0x32, 0x2A, 0x9A, 0xE4,
+ 0xCF, 0x17, 0xB7, 0xB8, 0xF4, 0xE1, 0x33, 0x08,
+ 0x24, 0x8B, 0xC4, 0x43, 0xA5, 0xE5, 0x24, 0xC2,
+};
+
/* Device capabilities feature report. */
static const uint8_t device_caps_response[] = {
REPORT_ID_DEVICE_CAPS,
@@ -350,6 +401,10 @@ static int get_report(uint8_t report_id, uint8_t report_type,
*buffer_ptr = device_caps_response;
*buffer_size = MIN(sizeof(device_caps_response), *buffer_size);
return 0;
+ case REPORT_ID_DEVICE_CERT:
+ *buffer_ptr = device_cert_response;
+ *buffer_size = MIN(sizeof(device_cert_response), *buffer_size);
+ return 0;
}
return -1;
}