From 5b8b06e976623ad52a1c4c558dfdac8b1c9d3dc7 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Mon, 6 Mar 2017 15:11:31 -0800 Subject: [PATCH] hammer: Switch trackpad I2C to 400 kHz, decrease EP interval to 2ms These 2 changes improve the measured touchpad drag latency. BRANCH=none BUG=b:35587172 TEST=Measure improved latency with WALT. TEST=Using CONFIG_TRACE, look at output. Change-Id: Ibeb90f6f92423e82100f17df79b2f20d90abfeb7 Reviewed-on: https://chromium-review.googlesource.com/450980 Commit-Ready: Nicolas Boichat Tested-by: Nicolas Boichat Reviewed-by: Charlie Mooney Reviewed-by: Vincent Palatin --- board/hammer/board.c | 2 +- chip/stm32/usb_hid_touchpad.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/board/hammer/board.c b/board/hammer/board.c index 73ade52cbb..5bc8b86fcb 100644 --- a/board/hammer/board.c +++ b/board/hammer/board.c @@ -44,7 +44,7 @@ BUILD_ASSERT(ARRAY_SIZE(usb_strings) == USB_STR_COUNT); /* I2C ports */ const struct i2c_port_t i2c_ports[] = { - {"master", I2C_PORT_MASTER, 100, + {"master", I2C_PORT_MASTER, 400, GPIO_MASTER_I2C_SCL, GPIO_MASTER_I2C_SDA}, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); diff --git a/chip/stm32/usb_hid_touchpad.c b/chip/stm32/usb_hid_touchpad.c index 92e1b09886..15b7f6554c 100644 --- a/chip/stm32/usb_hid_touchpad.c +++ b/chip/stm32/usb_hid_touchpad.c @@ -28,7 +28,7 @@ * Touchpad EP interval: Make sure this value is smaller than the typical * interrupt interval from the trackpad. */ -#define HID_TOUCHPAD_EP_INTERVAL_MS 8 /* ms */ +#define HID_TOUCHPAD_EP_INTERVAL_MS 2 /* ms */ /* HID descriptors */ const struct usb_interface_descriptor USB_IFACE_DESC(USB_IFACE_HID_TOUCHPAD) = {