diff options
author | Wei-Han Chen <stimim@google.com> | 2018-05-17 18:24:40 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-29 06:02:12 -0700 |
commit | 3eb6cd87a1873ee281a783cb1db405caeb78077f (patch) | |
tree | 49fe15a326ce9080d3818b17d370d13245c81859 /driver | |
parent | 71e33a910eb5c54aad4409c95e495598fb88bafa (diff) | |
download | chrome-ec-3eb6cd87a1873ee281a783cb1db405caeb78077f.tar.gz |
driver/touchpad_st.c: call full initialization via touchpad_debug
BRANCH=none
BUG=b:70482333
BUG=b:78483107
TEST=manual test on whiskers
Signed-off-by: Wei-Han Chen <stimim@chromium.org>
Change-Id: I57f96331d75a54c52f31305fee7090930ed845cd
Reviewed-on: https://chromium-review.googlesource.com/1071314
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 'driver')
-rw-r--r-- | driver/touchpad_st.c | 13 | ||||
-rw-r--r-- | driver/touchpad_st.h | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c index da52935d9d..e20a2810f3 100644 --- a/driver/touchpad_st.c +++ b/driver/touchpad_st.c @@ -763,7 +763,18 @@ int touchpad_update_write(int offset, int size, const uint8_t *data) int touchpad_debug(const uint8_t *param, unsigned int param_size, uint8_t **data, unsigned int *data_size) { - return EC_RES_INVALID_COMMAND; + if (param_size != 1) + return EC_RES_INVALID_PARAM; + + switch (*param) { + case ST_TP_DEBUG_CMD_CALIBRATE: + /* no return value */ + *data = NULL; + *data_size = 0; + st_tp_full_initialize(); + return EC_SUCCESS; + } + return EC_RES_INVALID_PARAM; } #endif diff --git a/driver/touchpad_st.h b/driver/touchpad_st.h index a099d941ea..94771b0cf1 100644 --- a/driver/touchpad_st.h +++ b/driver/touchpad_st.h @@ -244,5 +244,7 @@ enum ST_TP_MODE { HEAT_MAP_MODE, }; +#define ST_TP_DEBUG_CMD_CALIBRATE 0x1 + #endif /* __CROS_EC_TOUCHPAD_ST_H */ |