From d688eb234bad38d318d4da7d018757ba07b74a9b Mon Sep 17 00:00:00 2001 From: dengwei1 Date: Mon, 29 Oct 2018 15:44:35 +0800 Subject: [PATCH] channel input update ilitek touch firmware block number. update ilitek touch firmware block number as vendor suggested Change-Id: I1a30717b60714b36467589a80a1f2fc7f466ba70 Signed-off-by: dengwei1 Reviewed-on: https://gerrit.mot.com/1261966 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- drivers/input/touchscreen/ilitek_mmi/common.h | 1 + drivers/input/touchscreen/ilitek_mmi/core/firmware.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/ilitek_mmi/common.h b/drivers/input/touchscreen/ilitek_mmi/common.h index c90eeb2eb975..e232c0cb4f0b 100644 --- a/drivers/input/touchscreen/ilitek_mmi/common.h +++ b/drivers/input/touchscreen/ilitek_mmi/common.h @@ -173,6 +173,7 @@ extern uint32_t ipio_chip_list[2]; #define DLM_HEX_ADDRESS 0x10000 #define MP_HEX_ADDRESS 0x13000 #define SPI_UPGRADE_LEN 2048 +#define FW_BLOCK_INFO_NUM 6 #define UPDATE_RETRY_COUNT 3 /* ILI7807 Series */ diff --git a/drivers/input/touchscreen/ilitek_mmi/core/firmware.c b/drivers/input/touchscreen/ilitek_mmi/core/firmware.c index c344ecfa1fbe..398ee9d204ed 100644 --- a/drivers/input/touchscreen/ilitek_mmi/core/firmware.c +++ b/drivers/input/touchscreen/ilitek_mmi/core/firmware.c @@ -1431,10 +1431,10 @@ static int convert_hex_file(uint8_t *pBuf, uint32_t nSize, bool isIRAM) nExAddr = nExAddr >> 12; } - if (nType == 0xAE) { + if (nType == 0xAE || nType == 0xAF) { core_firmware->hasBlockInfo = true; /* insert block info extracted from hex */ - if (block < 4) { + if (block < FW_BLOCK_INFO_NUM) { g_flash_block_info[block].start_addr = HexToDec(&pBuf[i + 9], 6); g_flash_block_info[block].end_addr = HexToDec(&pBuf[i + 9 + 6], 6); ipio_debug(DEBUG_FIRMWARE, "Block[%d]: start_addr = %x, end = %x\n",