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",