summaryrefslogtreecommitdiff
path: root/ft3658/focaltech_test
diff options
context:
space:
mode:
authorMason Wang <masonwang@google.com>2022-03-03 16:26:23 +0800
committerMason Wang <masonwang@google.com>2022-03-03 16:26:23 +0800
commit63fb0f34aa67daaa26e876e0d334056ec2612212 (patch)
tree98e5f1a3993a56c546f53434831c3d9414137d65 /ft3658/focaltech_test
parenta02b593b08089634ba69d3a31de3d1e44118ef67 (diff)
downloadfocaltech_touch-63fb0f34aa67daaa26e876e0d334056ec2612212.tar.gz
touch/focaltech: support v4l2 heatmap
Bug: 199105079 Test: install v4l-heatmap-viewer.apk to check the result. Signed-off-by: Mason Wang <masonwang@google.com> Change-Id: I3a846f480ad8f59daeada2fd5e96e7e148c128d2
Diffstat (limited to 'ft3658/focaltech_test')
-rw-r--r--ft3658/focaltech_test/focaltech_test.c21
-rw-r--r--ft3658/focaltech_test/supported_ic/focaltech_test_ft3658u.c7
2 files changed, 17 insertions, 11 deletions
diff --git a/ft3658/focaltech_test/focaltech_test.c b/ft3658/focaltech_test/focaltech_test.c
index 1e6229e..11cd910 100644
--- a/ft3658/focaltech_test/focaltech_test.c
+++ b/ft3658/focaltech_test/focaltech_test.c
@@ -2789,7 +2789,7 @@ static const struct file_operations proc_test_baseline_fops = {
/* Strength test for full size */
/* transpose raw */
-static void transpose_raw(u8 *src, u8 *dist, int tx, int rx) {
+void transpose_raw(u8 *src, u8 *dist, int tx, int rx) {
int i = 0;
int j = 0;
@@ -2817,6 +2817,7 @@ static int proc_test_strength_show(struct seq_file *s, void *v)
u8 *base_raw;
u8 *trans_raw;
+ int base_raw_len = 0;
int base = 0;
int Fast_events_x = 0;
int Fast_events_y = 0;
@@ -2830,17 +2831,18 @@ static int proc_test_strength_show(struct seq_file *s, void *v)
node_num = tx * rx;
self_node = tx + rx;
- self_cap_num = self_cap_offset + node_num * 2;
- self_cap_num_off = self_cap_num + self_cap_len * 2;
-
- base_raw = fts_malloc(self_cap_num * sizeof(int));
+ self_cap_num = self_cap_offset + node_num * sizeof(u16);
+ self_cap_num_off = self_cap_num + self_cap_len * sizeof(u16);
+ base_raw_len = self_cap_num + self_cap_len * 2 * sizeof(u16);
+ FTS_DEBUG("heapmap base_raw length = %d", base_raw_len);
+ base_raw = fts_malloc(base_raw_len);
if (!base_raw) {
FTS_ERROR("malloc memory for raw fails");
ret = -ENOMEM;
goto exit;
}
- trans_raw = fts_malloc(node_num * 2 * sizeof(int));
+ trans_raw = fts_malloc(node_num * sizeof(u16));
if (!trans_raw) {
FTS_ERROR("malloc memory for transpose raw fails");
ret = -ENOMEM;
@@ -2862,13 +2864,14 @@ static int proc_test_strength_show(struct seq_file *s, void *v)
(base_raw[3 + base] & 0xFF);
Fast_events_y = ((base_raw[4 + base] & 0x0F) << 8) +
(base_raw[5 + base] & 0xFF);
- Fast_events_id = (base_raw[4 + base]& 0xF0) >> 4;
+ Fast_events_id = (base_raw[4 + base] & 0xF0) >> 4;
seq_printf(s, "Finger ID= %d , X= %d, y=%d\n", Fast_events_id,
- Fast_events_x,Fast_events_y);
+ Fast_events_x, Fast_events_y);
}
seq_printf(s, " ");
/* transpose data buffer. */
+ FTS_DEBUG("index(mutual) = %d", self_cap_offset);
transpose_raw(base_raw + self_cap_offset, trans_raw, tx, rx);
for (i = 0; i < tx; i++)
seq_printf(s, " TX%02d ", (i + 1));
@@ -2886,6 +2889,7 @@ static int proc_test_strength_show(struct seq_file *s, void *v)
/*---------output self of strength data-----------*/
seq_printf(s, "\n");
seq_printf(s, "Scap raw(proof on):\n");
+ FTS_DEBUG("index(rx) = %d", self_cap_num);
for (i = 0; i < self_node; i++) {
base_result = (int)(base_raw[(i * 2) + self_cap_num] << 8) +
(int)base_raw[(i * 2) + self_cap_num + 1];
@@ -2894,6 +2898,7 @@ static int proc_test_strength_show(struct seq_file *s, void *v)
seq_printf(s, "RX:");
if(i == rx) {
+ FTS_DEBUG("index(tx) = %d", (self_cap_num + (i * 2)));
seq_printf(s, "\n");
seq_printf(s, "TX:");
}
diff --git a/ft3658/focaltech_test/supported_ic/focaltech_test_ft3658u.c b/ft3658/focaltech_test/supported_ic/focaltech_test_ft3658u.c
index 18fe79a..e048225 100644
--- a/ft3658/focaltech_test/supported_ic/focaltech_test_ft3658u.c
+++ b/ft3658/focaltech_test/supported_ic/focaltech_test_ft3658u.c
@@ -2042,8 +2042,9 @@ int fts_test_get_strength(u8 *base_raw, u8 tx, u8 rx)
int ret = 0;
int self_cap_offset = 91;
int self_cap_len = 68;
- int self_data_len = self_cap_len * 2 * 2;
- int fast_num_len = self_cap_offset + 2 * (tx * rx) + self_data_len;
+ int self_data_len = self_cap_len * 2; /* cap and cap_off */
+ int fast_num_len = self_cap_offset +
+ ((tx * rx) + self_data_len) * sizeof(u16);
u8 id_cmd[4] = {0};
FTS_TEST_INFO("====== Test Item: strength test start\n");
@@ -2051,7 +2052,7 @@ int fts_test_get_strength(u8 *base_raw, u8 tx, u8 rx)
fts_set_heatmap_mode(true);
sys_delay(500);
-
+ FTS_TEST_DBG("Allocate heatmap length = %d.\n", fast_num_len);
ret = fts_read(id_cmd, 1, base_raw, fast_num_len);
if (ret < 0) {