diff options
author | Wei-Han Chen <stimim@google.com> | 2018-08-31 11:59:13 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-08-31 11:19:48 -0700 |
commit | d13deb3437db0acc573dfa00ad40d0a227211189 (patch) | |
tree | 01703b5580d34898658d03c77010025800b105a1 /driver/touchpad_st.c | |
parent | 188dc60833566b6c93165b60ef1e04b89999c6e0 (diff) | |
download | chrome-ec-d13deb3437db0acc573dfa00ad40d0a227211189.tar.gz |
touchpad_st: disable heatmap should always success
We should only fail if host is trying to enable heatmap via
`Set_Interface` command. Setting altsetting to 0 (disable
heatmap) should always success.
BRANCH=none
BUG=b:113141452
TEST=tested on whiskers
Signed-off-by: Wei-Han Chen <stimim@chromium.org>
Change-Id: I540ce7af46bd2bf84dccb0d21bf0ad89ade3c9e9
Reviewed-on: https://chromium-review.googlesource.com/1198943
Commit-Ready: Wei-Han Chen <stimim@chromium.org>
Tested-by: Wei-Han Chen <stimim@chromium.org>
Reviewed-by: Wei-Han Chen <stimim@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'driver/touchpad_st.c')
-rw-r--r-- | driver/touchpad_st.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c index 424069c275..f6c29a9a01 100644 --- a/driver/touchpad_st.c +++ b/driver/touchpad_st.c @@ -1176,14 +1176,15 @@ 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) { - 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) { + 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; + } + hook_call_deferred(&st_tp_enable_heat_map_data, 0); return 0; } else if (alternate_setting == 0) { |