summaryrefslogtreecommitdiff
path: root/goodix_ts_core.c
diff options
context:
space:
mode:
authorWendly Li <wendlyli@google.com>2022-07-29 02:55:01 +0000
committerWendly Li <wendlyli@google.com>2022-07-29 02:55:26 +0000
commitd374564f361193a2ab5948470d093cea37c4377c (patch)
tree591b524f91adacb443565286fc303c330b08d7df /goodix_ts_core.c
parentd1a31164a45b2550d0b7e4514cbf9a82e829edfc (diff)
downloadgoodix_touch-d374564f361193a2ab5948470d093cea37c4377c.tar.gz
touch/goodix: Support ping and get-fw-version for gti
Bug: 214118904 Test: Check dumpstate works properly Change-Id: Iffdfed8a2fd9c052bb87276e7eb52520196584d7 Signed-off-by: Wendly Li <wendlyli@google.com>
Diffstat (limited to 'goodix_ts_core.c')
-rw-r--r--goodix_ts_core.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/goodix_ts_core.c b/goodix_ts_core.c
index 29bd2ea..64dfcd9 100644
--- a/goodix_ts_core.c
+++ b/goodix_ts_core.c
@@ -976,6 +976,29 @@ static int set_heatmap_enabled(
return cd->hw_ops->set_heatmap_enabled(cd, cmd->setting == GTI_HEATMAP_ENABLE);
}
+static int gti_get_fw_version(void *private_data,
+ struct gti_fw_version_cmd *cmd)
+{
+ struct goodix_ts_core *cd = private_data;
+ int ret = 0;
+
+ ret = cd->hw_ops->read_version(cd, &cd->fw_version);
+ if (ret) {
+ return ret;
+ }
+
+ snprintf(cmd->buffer, sizeof(cmd->buffer), "%02x.%02x.%02x.%02x",
+ cd->fw_version.patch_vid[0], cd->fw_version.patch_vid[1],
+ cd->fw_version.patch_vid[2], cd->fw_version.patch_vid[3]);
+ return ret;
+}
+
+static int gti_ping(void *private_data, struct gti_ping_cmd *cmd)
+{
+ struct goodix_ts_core *cd = private_data;
+ return cd->hw_ops->ping(cd);
+}
+
#endif
/* prosfs create */
@@ -2589,6 +2612,8 @@ int goodix_ts_stage2_init(struct goodix_ts_core *cd)
options->set_screen_protector_mode = set_screen_protector_mode;
options->get_screen_protector_mode = get_screen_protector_mode;
options->set_heatmap_enabled = set_heatmap_enabled;
+ options->get_fw_version = gti_get_fw_version;
+ options->ping = gti_ping;
cd->gti = goog_touch_interface_probe(
cd, cd->bus->dev, cd->input_dev, gti_default_handler, options);