summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2022-07-29 02:00:01 +0000
committerAndroid Partner Code Review <android-gerrit-partner@google.com>2022-07-29 02:00:01 +0000
commiteb1b838dcce6d18b9bb43c75311ab09693bdaeb2 (patch)
tree773fd121c1d1fffa9425a7ff0c524c65c2975063
parent5057ab493500d98f9454e799071f52e95a46b124 (diff)
parent6496483dae3a6c847c00f852d0de11a20f6ea110 (diff)
downloadfocaltech_touch-eb1b838dcce6d18b9bb43c75311ab09693bdaeb2.tar.gz
Merge "touch/focaltech: support to report SS_WATER data." into android13-gs-pixel-5.10-tm-qpr1
-rw-r--r--ft3658/focaltech_core.c32
-rw-r--r--ft3658/focaltech_core.h5
2 files changed, 31 insertions, 6 deletions
diff --git a/ft3658/focaltech_core.c b/ft3658/focaltech_core.c
index e38bba8..12fee4b 100644
--- a/ft3658/focaltech_core.c
+++ b/ft3658/focaltech_core.c
@@ -1780,8 +1780,12 @@ static void fts_populate_mutual_channel(struct fts_ts_data *ts_data,
static void fts_populate_self_channel(struct fts_ts_data *ts_data,
struct touch_offload_frame *frame, int channel)
{
- int i;
- int idx = 0;
+ u8 ss_type = 0;
+ int idx_ss_normal = ts_data->pdata->tx_ch_num * ts_data->pdata->rx_ch_num;
+ int idx_ss_water = ts_data->pdata->tx_ch_num * ts_data->pdata->rx_ch_num +
+ ts_data->pdata->tx_ch_num + ts_data->pdata->rx_ch_num;
+ int ss_size =
+ (ts_data->pdata->tx_ch_num + ts_data->pdata->rx_ch_num) * sizeof(u16);
struct TouchOffloadData1d *self_strength =
(struct TouchOffloadData1d *)frame->channel_data[channel];
@@ -1791,10 +1795,25 @@ static void fts_populate_self_channel(struct fts_ts_data *ts_data,
self_strength->header.channel_size =
TOUCH_OFFLOAD_FRAME_SIZE_1D(self_strength->rx_size,
self_strength->tx_size);
- idx = ts_data->pdata->tx_ch_num * ts_data->pdata->rx_ch_num;
- for (i = 0; i < ts_data->pdata->tx_ch_num + ts_data->pdata->rx_ch_num; i++) {
- ((u16 *) self_strength->data)[i] =
- ((u16 *) ts_data->heatmap_buff)[idx + i];
+
+ switch (frame->channel_type[channel] & ~TOUCH_SCAN_TYPE_SELF) {
+ case TOUCH_DATA_TYPE_FILTERED:
+ ss_type = SS_WATER;
+ break;
+ case TOUCH_DATA_TYPE_STRENGTH:
+ default:
+ ss_type = SS_NORMAL;
+ break;
+ }
+
+ if (ss_type == SS_WATER) {
+ /* Copy Water-SS. */
+ memcpy(self_strength->data, ts_data->heatmap_buff + idx_ss_water,
+ ss_size);
+ } else {
+ /* Copy Normal-SS. */
+ memcpy(self_strength->data, ts_data->heatmap_buff + idx_ss_normal,
+ ss_size);
}
}
@@ -2923,6 +2942,7 @@ static int fts_ts_probe_entry(struct fts_ts_data *ts_data)
ts_data->offload.caps.heatmap_size = HEATMAP_SIZE_FULL;
ts_data->offload.caps.touch_data_types = TOUCH_DATA_TYPE_COORD |
TOUCH_DATA_TYPE_STRENGTH |
+ TOUCH_DATA_TYPE_FILTERED |
TOUCH_DATA_TYPE_RAW;
ts_data->offload.caps.touch_scan_types = TOUCH_SCAN_TYPE_MUTUAL |
TOUCH_SCAN_TYPE_SELF;
diff --git a/ft3658/focaltech_core.h b/ft3658/focaltech_core.h
index 515d28a..a665e5c 100644
--- a/ft3658/focaltech_core.h
+++ b/ft3658/focaltech_core.h
@@ -224,6 +224,11 @@ struct fts_gesture_st {
int orientation[FTS_GESTURE_POINTS_MAX];
};
+enum SS_TYPE {
+ SS_NORMAL,
+ SS_WATER,
+};
+
struct fts_ts_data {
struct i2c_client *client;
struct spi_device *spi;