summaryrefslogtreecommitdiff
path: root/ft3658/focaltech_ex_fun.c
diff options
context:
space:
mode:
authorMason Wang <masonwang@google.com>2022-05-13 10:04:36 +0800
committerMason Wang <masonwang@google.com>2022-06-10 21:30:14 +0800
commit7bf5b6be4fcc55c730f522e263f8bf9c1e4bec6a (patch)
tree8882fd1d3a8d3225cc91d30a557d76c12269f728 /ft3658/focaltech_ex_fun.c
parent92bfa01d6efe6b5e4028e12ae74dfe6e7c431d77 (diff)
downloadfocaltech_touch-7bf5b6be4fcc55c730f522e263f8bf9c1e4bec6a.tar.gz
touch/focaltech: Compressed MS and add SS_WATER.
Change list: 1. Compress the mutual-sensing data. The purpose is to reduce the data count of heatmap through SPI. To compress the mutual-sensing data in firmware side, and to decompress it in kernel driver side. It reduces the transferring data form 1088 bytes to 50 bytes/per finger). 2. Add water-on self-sensing data. Bug: 228953908 Test: Touch, v4l, twoshay works well. Change-Id: I18ee794aa9ef098764e8483f87f6697d5bff06d0
Diffstat (limited to 'ft3658/focaltech_ex_fun.c')
-rw-r--r--ft3658/focaltech_ex_fun.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/ft3658/focaltech_ex_fun.c b/ft3658/focaltech_ex_fun.c
index dc59085..da22f2a 100644
--- a/ft3658/focaltech_ex_fun.c
+++ b/ft3658/focaltech_ex_fun.c
@@ -2090,6 +2090,7 @@ static ssize_t proc_heatmap_onoff_read(struct file *filp,
int ret = 0;
char tmpbuf[PROC_BUF_SIZE] = { 0 };
u8 mode = 0;
+ u8 compressed = 0;
loff_t pos = *ppos;
if (pos)
@@ -2097,11 +2098,21 @@ static ssize_t proc_heatmap_onoff_read(struct file *filp,
ret = fts_read_reg(FTS_REG_HEATMAP_9E, &mode);
if (ret < 0) {
- FTS_ERROR("read reg_0x9E fails");
+ FTS_ERROR("read reg_0x%X fails", FTS_REG_HEATMAP_9E);
return ret;
}
- cnt += snprintf(tmpbuf + cnt, PROC_BUF_SIZE - cnt, "heatmap function is %s\n",
+ if (mode) {
+ fts_read_reg(FTS_REG_HEATMAP_ED, &compressed);
+ if (ret < 0) {
+ FTS_ERROR("read reg_0x%X fails", FTS_REG_HEATMAP_ED);
+ return ret;
+ }
+ cnt += snprintf(tmpbuf + cnt, PROC_BUF_SIZE - cnt, "%s ",
+ compressed ? "Compressed" : "Uncompressed");
+ }
+
+ cnt += snprintf(tmpbuf + cnt, PROC_BUF_SIZE - cnt, "heatmap is %s\n",
mode ? "Enable" : "Disable");
if (copy_to_user(buff, tmpbuf, cnt)) {
@@ -2138,9 +2149,15 @@ static ssize_t proc_heatmap_onoff_write(struct file *filp,
return -EINVAL;
}
+ if (mode < FW_HEATMAP_MODE_DISABLE || mode > FW_HEATMAP_MODE_UNCOMPRESSED) {
+ FTS_ERROR("Please input the parameters in \n \
+ 0: Disable firmware heatmap. \n \
+ 1: Enable firmware compressed heatmap. \n \
+ 2: Enable firmware uncompressed heatmap.");
+ return -EINVAL;
+ }
FTS_INFO("switch heatmap on/off to %d", mode);
- fts_set_heatmap_mode(ts_data, !!mode);
-
+ fts_set_heatmap_mode(ts_data, mode);
return count;
}