summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei-Han Chen <stimim@google.com>2018-08-16 11:05:15 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-08-18 05:17:32 -0700
commit910bb230787e0ab50d6a996251b7393215b9a1e7 (patch)
treebc057e36b7e558597f7a4fb0397bab8c1ed1819a
parent2741f9db6f8d893b8dc8f0542e12563f35a9eda7 (diff)
downloadchrome-ec-910bb230787e0ab50d6a996251b7393215b9a1e7.tar.gz
touchpad_st: fix heatmap mode
The rx_buf was set incorrectly in heat map mode. Also add debug messages to help debugging. BRANCH=none BUG=b:70482333 TEST=test on full system, enable heatmap Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I325a9b7983a16634b95eecdc592c59222e48c7aa Reviewed-on: https://chromium-review.googlesource.com/1177093 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r--driver/touchpad_st.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c
index 4809e4838e..6650471663 100644
--- a/driver/touchpad_st.c
+++ b/driver/touchpad_st.c
@@ -326,6 +326,7 @@ static int st_tp_update_system_state(int new_state, int mask)
0
};
if (new_state & SYSTEM_STATE_ENABLE_HEAT_MAP) {
+ CPRINTS("Enable Heatmap");
tx_buf[2] |= 1 << 0;
need_locked_scan_mode = 1;
}
@@ -1043,7 +1044,7 @@ static int st_tp_read_frame(void)
* Let's skip this check for now.
*/
ret = spi_transaction(SPI, tx_buf, sizeof(tx_buf),
- (uint8_t *)&rx_buf, rx_len);
+ (uint8_t *)rx_buf, rx_len);
if (ret == EC_SUCCESS) {
int i;
uint8_t *dest = usb_packet[spi_buffer_index & 1].frame;
@@ -1175,9 +1176,12 @@ static int heatmap_send_packet(struct usb_isochronous_config const *config)
static int st_tp_usb_set_interface(usb_uint alternate_setting,
usb_uint interface)
{
- if ((system_info.release_info & 0xFF) < ST_TP_MIN_HEATMAP_VERSION)
+ if ((system_info.release_info & 0xFF) < ST_TP_MIN_HEATMAP_VERSION) {
+ CPRINTS("release version %04x doesn't support heatmap",
+ system_info.release_info);
/* Heatmap mode is not supported in this version. */
return -1;
+ }
if (alternate_setting == 1) {
hook_call_deferred(&st_tp_enable_heat_map_data, 0);