From 573b779264e2b818cf5d4f1223933082f6974141 Mon Sep 17 00:00:00 2001 From: hujing3 Date: Mon, 24 Dec 2018 16:13:48 +0800 Subject: [PATCH] channel: input 3rd nvt tp bringup channel: 3rd djn panel with new NVT IC tp bringup add new nvt IC NT36525B Change-Id: I0790e687feb112fdcd3ed3a2339a8e0d578a1855 Signed-off-by: hujing3 Reviewed-on: https://gerrit.mot.com/1286736 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Wei Deng Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- .../touchscreen/nova_36525_mmi/nt36xxx.c | 10 +++++-- .../touchscreen/nova_36525_mmi/nt36xxx.h | 5 ++-- .../nova_36525_mmi/nt36xxx_fw_update.c | 7 ++++- .../nova_36525_mmi/nt36xxx_mem_map.h | 28 +++++++++++++++++++ 4 files changed, 44 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/nova_36525_mmi/nt36xxx.c b/drivers/input/touchscreen/nova_36525_mmi/nt36xxx.c index d68d3610f438..4ab083d1c891 100644 --- a/drivers/input/touchscreen/nova_36525_mmi/nt36xxx.c +++ b/drivers/input/touchscreen/nova_36525_mmi/nt36xxx.c @@ -1184,12 +1184,14 @@ static int8_t nvt_ts_check_chip_ver_trim(void) NVT_LOG("This is NVT touch IC\n"); #if NVT_TOUCH_FW if (list == 0) { + snprintf(ts->product_id, sizeof(ts->product_id), "NT36525B"); + } else if (list == 1) { snprintf(ts->product_id, sizeof(ts->product_id), "NT36672A"); - } else if (list == 9) { - snprintf(ts->product_id, sizeof(ts->product_id), "NT36525"); } else if (list == 10) { - snprintf(ts->product_id, sizeof(ts->product_id), "NT36870"); + snprintf(ts->product_id, sizeof(ts->product_id), "NT36525"); } else if (list == 11) { + snprintf(ts->product_id, sizeof(ts->product_id), "NT36870"); + } else if (list == 12) { snprintf(ts->product_id, sizeof(ts->product_id), "NT36676F"); } else { snprintf(ts->product_id, sizeof(ts->product_id), "NT36772"); @@ -1270,6 +1272,8 @@ static int32_t nvt_ts_probe(struct i2c_client *client, const struct i2c_device_i goto err_chipvertrim_failed; } + nvt_read_pid(); + mutex_init(&ts->lock); mutex_lock(&ts->lock); diff --git a/drivers/input/touchscreen/nova_36525_mmi/nt36xxx.h b/drivers/input/touchscreen/nova_36525_mmi/nt36xxx.h index c0e0b018d59b..13ea757502cf 100644 --- a/drivers/input/touchscreen/nova_36525_mmi/nt36xxx.h +++ b/drivers/input/touchscreen/nova_36525_mmi/nt36xxx.h @@ -45,6 +45,7 @@ #define I2C_BLDR_Address 0x01 #define I2C_FW_Address 0x01 #define I2C_HW_Address 0x62 +#define PANNEL_ID 0x6013 #if NVT_DEBUG #define NVT_LOG(fmt, args...) pr_err("[%s] %s %d: " fmt, NVT_I2C_NAME, __func__, __LINE__, ##args) @@ -83,8 +84,8 @@ extern const uint16_t gesture_key_array[]; #endif #define BOOT_UPDATE_FIRMWARE 0 #define BOOT_UPDATE_FIRMWARE_NAME "novatek_ts_fw.bin" - -//---ESD Protect.--- +#define NT36525B_FIRMWARE_NAME "novatek_ts_fw_pid6013.bin" +/* ---ESD Protect.--- */ #define NVT_TOUCH_ESD_PROTECT 1 #define NVT_TOUCH_ESD_CHECK_PERIOD 2000 /* ms */ diff --git a/drivers/input/touchscreen/nova_36525_mmi/nt36xxx_fw_update.c b/drivers/input/touchscreen/nova_36525_mmi/nt36xxx_fw_update.c index ba75fc516e44..4907a2412e99 100644 --- a/drivers/input/touchscreen/nova_36525_mmi/nt36xxx_fw_update.c +++ b/drivers/input/touchscreen/nova_36525_mmi/nt36xxx_fw_update.c @@ -982,7 +982,12 @@ void Boot_Update_Firmware(struct work_struct *work) int32_t ret = 0; char firmware_name[256] = ""; - snprintf(firmware_name, sizeof(firmware_name), BOOT_UPDATE_FIRMWARE_NAME); + NVT_LOG("enter %s start\n",__func__); + if (ts->nvt_pid == PANNEL_ID) { + snprintf(firmware_name, sizeof(firmware_name), NT36525B_FIRMWARE_NAME); + } else { + snprintf(firmware_name, sizeof(firmware_name), BOOT_UPDATE_FIRMWARE_NAME); + } // request bin file in "/etc/firmware" ret = update_firmware_request(firmware_name); diff --git a/drivers/input/touchscreen/nova_36525_mmi/nt36xxx_mem_map.h b/drivers/input/touchscreen/nova_36525_mmi/nt36xxx_mem_map.h index 90d62dd70a08..678a266d8d2d 100644 --- a/drivers/input/touchscreen/nova_36525_mmi/nt36xxx_mem_map.h +++ b/drivers/input/touchscreen/nova_36525_mmi/nt36xxx_mem_map.h @@ -42,6 +42,32 @@ struct nvt_ts_mem_map { uint32_t RW_FLASH_DATA_ADDR; }; +static const struct nvt_ts_mem_map NT36525B_memory_map = { + .EVENT_BUF_ADDR = 0x21C00, + .RAW_PIPE0_ADDR = 0x20000, + .RAW_PIPE0_Q_ADDR = 0, + .RAW_PIPE1_ADDR = 0x23000, + .RAW_PIPE1_Q_ADDR = 0, + .BASELINE_ADDR = 0x20BFC, + .BASELINE_Q_ADDR = 0, + .BASELINE_BTN_ADDR = 0x23BFC, + .BASELINE_BTN_Q_ADDR = 0, + .DIFF_PIPE0_ADDR = 0x206DC, + .DIFF_PIPE0_Q_ADDR = 0, + .DIFF_PIPE1_ADDR = 0x236DC, + .DIFF_PIPE1_Q_ADDR = 0, + .RAW_BTN_PIPE0_ADDR = 0x20510, + .RAW_BTN_PIPE0_Q_ADDR = 0, + .RAW_BTN_PIPE1_ADDR = 0x23510, + .RAW_BTN_PIPE1_Q_ADDR = 0, + .DIFF_BTN_PIPE0_ADDR = 0x20BF0, + .DIFF_BTN_PIPE0_Q_ADDR = 0, + .DIFF_BTN_PIPE1_ADDR = 0x23BF0, + .DIFF_BTN_PIPE1_Q_ADDR = 0, + .READ_FLASH_CHECKSUM_ADDR = 0x24000, + .RW_FLASH_DATA_ADDR = 0x24002, +}; + static const struct nvt_ts_mem_map NT36672A_memory_map = { .EVENT_BUF_ADDR = 0x21C00, .RAW_PIPE0_ADDR = 0x20000, @@ -181,6 +207,8 @@ struct nvt_ts_trim_id_table { }; static const struct nvt_ts_trim_id_table trim_id_table[] = { + {.id = {0x0B, 0xFF, 0xFF, 0x25, 0x65, 0x03}, .mask = {1, 0, 0, 1, 1, 1}, + .mmap = &NT36525B_memory_map, .carrier_system = 0}, {.id = {0x0A, 0xFF, 0xFF, 0x72, 0x66, 0x03}, .mask = {1, 0, 0, 1, 1, 1}, .mmap = &NT36672A_memory_map, .carrier_system = 0}, {.id = {0x55, 0x00, 0xFF, 0x00, 0x00, 0x00}, .mask = {1, 1, 0, 1, 1, 1},