diff options
author | davidycchen <davidycchen@google.com> | 2020-03-19 22:29:55 +0800 |
---|---|---|
committer | David Chen <davidycchen@google.com> | 2020-03-25 02:47:44 +0000 |
commit | effc31741af678e2d602e95020ee0eff0c0a3923 (patch) | |
tree | 3ba9a96f5e5693701a528758110be3c390d933c6 | |
parent | 41de94c038dc17f6379bb69ffe3cc89c98415dbb (diff) | |
download | fts_touch_s5-effc31741af678e2d602e95020ee0eff0c0a3923.tar.gz |
touch:fts: add PI when config version is same as incoming firmware
If the config config version is same as incoming firmware, the panel is
not calibrated in factory. Driver will do PI when this condition happens.
Bug: 151900042
Test: Panel is calibrated with PI when config version is same with
incoming firmware.
Change-Id: I9c9d8fd6010d1ff774a25b40395915020a5def15
Signed-off-by: davidycchen <davidycchen@google.com>
-rw-r--r-- | fts.c | 33 | ||||
-rw-r--r-- | fts.h | 1 |
2 files changed, 33 insertions, 1 deletions
@@ -4194,6 +4194,9 @@ static int fts_fw_update(struct fts_ts_info *info) int ret; int error = 0; int init_type = NO_INIT; + int index; + int prop_len = 0; + struct device_node *np = info->dev->of_node; #if defined(PRE_SAVED_METHOD) || defined(COMPUTE_INIT_METHOD) int keep_cx = 1; @@ -4231,6 +4234,35 @@ static int fts_fw_update(struct fts_ts_info *info) __func__); } + if (of_property_read_bool(np, "st,force-pi-cfg-ver-map")) { + prop_len = of_property_count_u32_elems(np, + "st,force-pi-cfg-ver-map"); + info->board->force_pi_cfg_ver = devm_kzalloc(info->dev, + sizeof(u32) * prop_len, GFP_KERNEL); + if (info->board->force_pi_cfg_ver != NULL) { + for (index = 0; index < prop_len; index++) { + of_property_read_u32_index(np, + "st,force-pi-cfg-ver-map", + index, + &info->board->force_pi_cfg_ver[index]); + pr_info("%s: force PI config version: %04X", + __func__, + info->board->force_pi_cfg_ver[index]); + if(systemInfo.u16_cfgVer == + info->board->force_pi_cfg_ver[index]) { + pr_info("%s System config version %04X, do panel init", + __func__, systemInfo.u16_cfgVer); + init_type = SPECIAL_PANEL_INIT; + } + } + } else { + pr_err("%s: force_pi_cfg_ver is NULL", __func__); + } + } else { + pr_info("%s: of_property_read_bool(np, \"st,force-pi-cfg-ver-map\") failed.\n", + __func__); + } + if (info->board->auto_fw_update) { ret = flashProcedure(info->board->fw_name, info->reflash_fw, keep_cx); @@ -4270,7 +4302,6 @@ static int fts_fw_update(struct fts_ts_info *info) if (ret < OK) { pr_info("%s: No Panel CRC Error Found!\n", __func__); - init_type = NO_INIT; } else { pr_err("%s: Panel CRC Error FOUND! CRC ERROR = %02X\n", __func__, ret); @@ -295,6 +295,7 @@ struct fts_hw_platform_data { #endif struct drm_panel *panel; u32 initial_panel_index; + u32 *force_pi_cfg_ver; }; /* Bits for the bus reference mask */ |