From: dengwei1 Date: Wed, 19 Jun 2019 04:10:02 +0000 (+0800) Subject: kane: input update touch fw progress X-Git-Tag: MMI-QSAS30.62-33-3~124 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e1eab562a7c576237ce8a2cba49e9782870a3b50;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git kane: input update touch fw progress update the touch fw progress to make sure success Change-Id: I4eb39e13ddc74d629fb8e184033a5873db28f57f Signed-off-by: dengwei1 Reviewed-on: https://gerrit.mot.com/1373092 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Hua Tan Submit-Approved: Jira Key (cherry picked from commit f80727c7665bb31e5f78702db6c8a791c96b1091) Reviewed-on: https://gerrit.mot.com/1396782 --- diff --git a/drivers/input/touchscreen/hxchipset/himax_common.c b/drivers/input/touchscreen/hxchipset/himax_common.c index 260f6a92d2a8..2a79552002c2 100755 --- a/drivers/input/touchscreen/hxchipset/himax_common.c +++ b/drivers/input/touchscreen/hxchipset/himax_common.c @@ -46,6 +46,7 @@ char *i_CTPM_firmware_name = "Himax_firmware.bin"; bool g_auto_update_flag = false; #endif +bool g_fw_checksum = false; #if defined(HX_AUTO_UPDATE_FW) unsigned char *i_CTPM_FW = NULL; int i_CTPM_FW_len; @@ -2142,6 +2143,7 @@ static int himax_fw_updater (struct himax_ts_data *ts, const char *fileName) { const struct firmware *fw = NULL; int fw_type = 0; int result; + int update_times = 0; himax_int_enable(0); @@ -2155,6 +2157,7 @@ static int himax_fw_updater (struct himax_ts_data *ts, const char *fileName) { fw_type = (fw->size)/1024; I("Now FW size is : %dk\n", fw_type); +update_retry: switch (fw_type) { case 32: result = g_core_fp.fp_fts_ctpm_fw_upgrade_with_sys_fs_32k( @@ -2200,14 +2203,20 @@ static int himax_fw_updater (struct himax_ts_data *ts, const char *fileName) { E("%s: Flash command fail: %d\n", __func__, __LINE__); break; } - if (result == 0) - private_ts->fw_upgrade_status = FW_NOT_READY; - else + + if (result == 0) { + update_times++; + if(update_times < 3) + goto update_retry; + else + private_ts->fw_upgrade_status = FW_NOT_READY; + } else { + g_core_fp.fp_read_FW_ver(); + g_core_fp.fp_touch_information(); private_ts->fw_upgrade_status = READY_TO_SERVE; + } release_firmware(fw); - g_core_fp.fp_read_FW_ver(); - g_core_fp.fp_touch_information(); #ifdef HX_RST_PIN_FUNC g_core_fp.fp_ic_reset(true, false); @@ -2596,9 +2605,13 @@ int himax_chip_common_init(void) g_auto_update_flag |= g_core_fp.fp_flash_lastdata_check(); if (g_auto_update_flag) goto FW_force_upgrade; +#else + g_fw_checksum = (!g_core_fp.fp_calculateChecksum(false)); + g_fw_checksum |= g_core_fp.fp_flash_lastdata_check(); #endif #ifndef HX_ZERO_FLASH - g_core_fp.fp_read_FW_ver(); + if(g_fw_checksum == false) + g_core_fp.fp_read_FW_ver(); #endif #ifdef HX_AUTO_UPDATE_FW