From eb0519a7447c6b19c400acb24924e0db3df1269b Mon Sep 17 00:00:00 2001 From: Mason Wang Date: Thu, 3 Nov 2022 15:11:14 +0800 Subject: touch/ft3658: Support the status report of baseline refresh Replace the frequency hopping status with the baseline refresh status. This change started with the new firmware V14_D01. Bug: 257196242 Test: Verify pass by checking the status log. Signed-off-by: Mason Wang Change-Id: Ic777beec3323208b5282854bb34b0d34caccb47d --- ft3658/focaltech_core.c | 40 +++++++++++++++------------------------- ft3658/focaltech_core.h | 5 +++-- 2 files changed, 18 insertions(+), 27 deletions(-) (limited to 'ft3658') diff --git a/ft3658/focaltech_core.c b/ft3658/focaltech_core.c index d778ce7..aa2c3ca 100644 --- a/ft3658/focaltech_core.c +++ b/ft3658/focaltech_core.c @@ -56,9 +56,6 @@ /***************************************************************************** * Private constant and macro definitions using #define *****************************************************************************/ -#if GOOGLE_REPORT_MODE -const short int hopping_freq[4] = {277, 237, 112, 0}; -#endif #define FTS_DRIVER_NAME "fts_ts" #define FTS_DRIVER_PEN_NAME "fts_ts,pen" #define INTERVAL_READ_REG 200 /* unit:ms */ @@ -91,8 +88,8 @@ static int fts_ts_resume(struct device *dev); static void fts_update_motion_filter(struct fts_ts_data *ts, u8 touches); static char *status_list_str[STATUS_CNT_END] = { - "Hopping", - "reserved", + "Baseline refreshed", + "Baseline refreshed", "Palm", "Water", "Grip", @@ -108,6 +105,14 @@ static char *feature_list_str[FW_CNT_END] = { "FW_HEATMAP", "FW_CONTINUOUS", }; + +static char *status_baseline_refresh_str[4] = { + "Baseline refreshed: none", + "Baseline refreshed: removing touch", + "Baseline refreshed: removing water", + "Baseline refreshed: removing shell iron", +}; + int fts_check_cid(struct fts_ts_data *ts_data, u8 id_h) { int i = 0; @@ -807,8 +812,6 @@ static int fts_read_touchdata(struct fts_ts_data *data) #if IS_ENABLED(GOOGLE_REPORT_MODE) u8 regB2_data[FTS_CUSTOMER_STATUS_LEN] = { 0 }; u8 check_regB2_status[2] = { 0 }; - u8 current_hopping = 0; - u8 new_hopping = 0; int i; if (data->work_mode == FTS_REG_WORKMODE_WORK_VALUE) { @@ -862,19 +865,10 @@ static int fts_read_touchdata(struct fts_ts_data *data) check_regB2_status[0] = regB2_data[0] ^ data->current_host_status[0] ; if (check_regB2_status[0]) { // current_status is different with previous_status - for(i = STATUS_HOPPING; i < STATUS_CNT_END; i++) { - if (i == STATUS_HOPPING) { - current_hopping = data->current_host_status[0] & 0x03; - new_hopping = regB2_data[0] & 0x03; - if (current_hopping != new_hopping && - current_hopping < 3 && - new_hopping < 3) { - FTS_INFO("-------%s (%dKhz => %dKhz)\n", - status_list_str[i], - hopping_freq[current_hopping], - hopping_freq[new_hopping]); - i++; - } + for (i = STATUS_BASELINE_REFRESH_B1; i < STATUS_CNT_END; i++) { + if ((i == STATUS_BASELINE_REFRESH_B1) && (check_regB2_status[0] & 0x03)) { + FTS_INFO("-------%s\n", + status_baseline_refresh_str[regB2_data[0] & 0x03]); } else { bool status_changed = check_regB2_status[0] & (1 << i); bool new_status = regB2_data[0] & (1 << i); @@ -899,7 +893,7 @@ static int fts_read_touchdata(struct fts_ts_data *data) bool feature_enabled; FTS_ERROR("FW settings dose not match host side, host: 0x%x, B2[1]:0x%x\n", data->current_host_status[1], regB2_data[1]); - for(i = FW_GLOVE; i < FW_CNT_END; i++) { + for (i = FW_GLOVE; i < FW_CNT_END; i++) { feature_changed = check_regB2_status[1] & (1 << i); feature_enabled = regB2_data[1] & (1 << i); if (feature_changed) { @@ -3167,10 +3161,6 @@ static int fts_ts_probe_entry(struct fts_ts_data *ts_data) ts_data->work_mode = FTS_REG_WORKMODE_WORK_VALUE; #if GOOGLE_REPORT_MODE fts_read_reg(FTS_REG_CUSTOMER_STATUS, &ts_data->current_host_status[0]); - if ((ts_data->current_host_status[0] & 0x03) < 3) { - FTS_DEBUG("-------Hopping %dKhz\n", - hopping_freq[(ts_data->current_host_status[0] & 0x03)]); - } FTS_INFO("-------Palm mode %s\n", (ts_data->current_host_status[0] & (1 << STATUS_PALM)) ? "enter" : "exit"); FTS_INFO("-------Water mode %s\n", diff --git a/ft3658/focaltech_core.h b/ft3658/focaltech_core.h index f8afe13..c86c92d 100644 --- a/ft3658/focaltech_core.h +++ b/ft3658/focaltech_core.h @@ -372,8 +372,9 @@ enum FTS_BUS_TYPE { #if GOOGLE_REPORT_MODE enum FTS_CUSTOMER_STATUS { - STATUS_HOPPING = 0, - STATUS_PALM = 2, + STATUS_BASELINE_REFRESH_B0, + STATUS_BASELINE_REFRESH_B1, + STATUS_PALM, STATUS_WATER, STATUS_GRIP, STATUS_GLOVE, -- cgit v1.2.3