From 910bb230787e0ab50d6a996251b7393215b9a1e7 Mon Sep 17 00:00:00 2001 From: Wei-Han Chen Date: Thu, 16 Aug 2018 11:05:15 +0800 Subject: 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 Change-Id: I325a9b7983a16634b95eecdc592c59222e48c7aa Reviewed-on: https://chromium-review.googlesource.com/1177093 Commit-Ready: Wei-Han Chen Tested-by: Wei-Han Chen Reviewed-by: Nicolas Boichat --- driver/touchpad_st.c | 8 ++++++-- 1 file 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); -- cgit v1.2.1