summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei-Han Chen <stimim@google.com>2018-08-16 18:40:24 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-08-19 02:10:46 -0700
commit8aac0772eaa9eb686d57f38ee61a616caa4accbe (patch)
treec1802efe75aa68103201bedcd2ceb8f1300605d8
parent0ea75d24f26355dcc3186db9e58604c77fdd38c0 (diff)
downloadchrome-ec-8aac0772eaa9eb686d57f38ee61a616caa4accbe.tar.gz
touchpad_st: handle new domeswitch API
In latest ST firmware, domeswitch level is already reported, there is no domeswitch_chg anymore. BRANCH=none BUG=b:70482333 TEST=manual on device Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I6ce21f48ec8aa62a4167a86581acd2e2abee7ce6 Reviewed-on: https://chromium-review.googlesource.com/1177524 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.c18
-rw-r--r--driver/touchpad_st.h8
2 files changed, 10 insertions, 16 deletions
diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c
index 6650471663..11a85a90c8 100644
--- a/driver/touchpad_st.c
+++ b/driver/touchpad_st.c
@@ -200,16 +200,14 @@ static int st_tp_check_domeswitch_state(void)
if (ret)
return ret;
- if (rx_buf.buffer_header.flags & ST_TP_BUFFER_HEADER_DOMESWITCH_CHG) {
- /*
- * dome_switch_level from device is inverted.
- * That is, 0 => pressed, 1 => released.
- */
- set_bits(&system_state,
- (rx_buf.buffer_header.dome_switch_level ?
- 0 : SYSTEM_STATE_DOME_SWITCH_LEVEL),
- SYSTEM_STATE_DOME_SWITCH_LEVEL);
- }
+ ret = rx_buf.buffer_header.flags & ST_TP_BUFFER_HEADER_DOMESWITCH_LVL;
+ /*
+ * Domeswitch level from device is inverted.
+ * That is, 0 => pressed, 1 => released.
+ */
+ set_bits(&system_state,
+ ret ? 0 : SYSTEM_STATE_DOME_SWITCH_LEVEL,
+ SYSTEM_STATE_DOME_SWITCH_LEVEL);
return 0;
}
diff --git a/driver/touchpad_st.h b/driver/touchpad_st.h
index cae8d5f0f2..286c39cbab 100644
--- a/driver/touchpad_st.h
+++ b/driver/touchpad_st.h
@@ -176,16 +176,12 @@ struct st_tp_host_buffer_header_t {
#define ST_TP_BUFFER_HEADER_HEAT_MAP_MT_RDY (1 << 3)
#define ST_TP_BUFFER_HEADER_HEAT_MAP_SF_RDY (1 << 4)
#define ST_TP_BUFFER_HEADER_HEAT_MAP_SS_RDY (1 << 5)
-#define ST_TP_BUFFER_HEADER_DOMESWITCH_CHG (1 << 6)
+#define ST_TP_BUFFER_HEADER_DOMESWITCH_LVL (1 << 6)
uint8_t flags;
uint8_t reserved[3];
uint8_t heatmap_miss_count;
uint8_t event_count;
uint8_t event_miss_count;
- uint8_t dome_switch_down_count:3;
- uint8_t dome_switch_up_count:3;
- uint8_t dome_switch_level:1;
- uint8_t dome_switch_overflow:1;
} __packed;
struct st_tp_host_buffer_heat_map_t {
@@ -249,7 +245,7 @@ enum ST_TP_MODE {
#define ST_TP_HEAT_MAP_THRESHOLD 10
/* A minimum version that supports heatmap mode. */
-#define ST_TP_MIN_HEATMAP_VERSION 11
+#define ST_TP_MIN_HEATMAP_VERSION 0x12
#endif /* __CROS_EC_TOUCHPAD_ST_H */