DLKM: Change novatek touch driver

Update novatek touch driver base code for nt36672a

Change-Id: I455b4a49345a117ff76009a3a630ad09351d12c9
Signed-off-by: wengjun1 <wengjun1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1208690
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jialei Hao <haojl2@motorola.com>
Reviewed-by: Wei Deng <dengwei1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
wengjun1 2018-07-12 15:43:35 +08:00 • committed by Jun Weng
commit a4c7f23c61
7 changed files with 1473 additions and 1611 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
/*
* Copyright (C) 2010 - 2017 Novatek, Inc.
*
* $Revision: 22429 $
* $Date: 2018-01-30 19:42:59 +0800 (Tue, 30 Jan 2018) $
* $Revision: 17989 $
* $Date: 2017-10-31 21:25:50 +0800 (週二, 31 十月 2017) $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -25,22 +25,12 @@
#include <linux/earlysuspend.h>
#endif
#include "nt36xxx_mem_map.h"
#define NVT_DEBUG 1
#define NVT_DEBUG 0
//---GPIO number---
#define NVTTOUCH_RST_PIN 980
#define NVTTOUCH_INT_PIN 943
//---INT trigger mode---
//#define IRQ_TYPE_EDGE_RISING 1
//#define IRQ_TYPE_EDGE_FALLING 2
#define INT_TRIGGER_TYPE IRQ_TYPE_EDGE_RISING
//---I2C driver info.---
#define NVT_I2C_NAME "NVT-ts"
#define I2C_BLDR_Address 0x01
#define I2C_FW_Address 0x01
@ -53,13 +43,10 @@
#endif
#define NVT_ERR(fmt, args...) pr_err("[%s] %s %d: " fmt, NVT_I2C_NAME, __func__, __LINE__, ##args)
//---Input device info.---
#define NVT_TS_NAME "NVTCapacitiveTouchScreen"
//---Touch info.---
#define TOUCH_DEFAULT_MAX_WIDTH 720
#define TOUCH_DEFAULT_MAX_HEIGHT 1512
#define TOUCH_DEFAULT_MAX_WIDTH 1080
#define TOUCH_DEFAULT_MAX_HEIGHT 2246
#define TOUCH_MAX_FINGER_NUM 10
#define TOUCH_KEY_NUM 0
#if TOUCH_KEY_NUM > 0
@ -67,13 +54,11 @@ extern const uint16_t touch_key_array[TOUCH_KEY_NUM];
#endif
#define TOUCH_FORCE_NUM 1000
/* Enable only when module have tp reset pin and connected to host */
#define NVT_TOUCH_SUPPORT_HW_RST 1
//---Customerized func.---
#define NVT_TOUCH_PROC 1
#define NVT_TOUCH_EXT_PROC 1
#define NVT_TOUCH_FW 1
#define NVT_TOUCH_MP 1
#define NVT_TOUCH_MP_LENOVO 1
#define MT_PROTOCOL_B 1
#define WAKEUP_GESTURE 0
#if WAKEUP_GESTURE
@ -81,10 +66,35 @@ 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 NVT_TOUCH_ESD_PROTECT 1
#define NVT_TOUCH_ESD_CHECK_PERIOD 2000 /* ms */
//---ESD Protect.---
#define NVT_TOUCH_ESD_PROTECT 0
#define NVT_TOUCH_ESD_CHECK_PERIOD 1500 /* ms */
struct nvt_ts_mem_map {
uint32_t EVENT_BUF_ADDR;
uint32_t RAW_PIPE0_ADDR;
uint32_t RAW_PIPE0_Q_ADDR;
uint32_t RAW_PIPE1_ADDR;
uint32_t RAW_PIPE1_Q_ADDR;
uint32_t BASELINE_ADDR;
uint32_t BASELINE_Q_ADDR;
uint32_t BASELINE_BTN_ADDR;
uint32_t BASELINE_BTN_Q_ADDR;
uint32_t DIFF_PIPE0_ADDR;
uint32_t DIFF_PIPE0_Q_ADDR;
uint32_t DIFF_PIPE1_ADDR;
uint32_t DIFF_PIPE1_Q_ADDR;
uint32_t RAW_BTN_PIPE0_ADDR;
uint32_t RAW_BTN_PIPE0_Q_ADDR;
uint32_t RAW_BTN_PIPE1_ADDR;
uint32_t RAW_BTN_PIPE1_Q_ADDR;
uint32_t DIFF_BTN_PIPE0_ADDR;
uint32_t DIFF_BTN_PIPE0_Q_ADDR;
uint32_t DIFF_BTN_PIPE1_ADDR;
uint32_t DIFF_BTN_PIPE1_Q_ADDR;
uint32_t READ_FLASH_CHECKSUM_ADDR;
uint32_t RW_FLASH_DATA_ADDR;
};
struct nvt_ts_data {
struct i2c_client *client;
@ -114,8 +124,19 @@ struct nvt_ts_data {
const struct nvt_ts_mem_map *mmap;
uint8_t carrier_system;
uint16_t nvt_pid;
#if NVT_TOUCH_FW
int8_t product_id[10];
uint8_t suspended;
uint8_t force_reflash;
uint8_t loading_fw;
#endif
};
#if NVT_TOUCH_FW
#define FW_NAME_MAX_LEN 80
#define VENDOR_NAME "novatek_ts"
#endif
#if NVT_TOUCH_PROC
struct nvt_flash_data{
rwlock_t lock;
@ -124,10 +145,10 @@ struct nvt_flash_data{
#endif
typedef enum {
RESET_STATE_INIT = 0xA0,// IC reset
RESET_STATE_REK, // ReK baseline
RESET_STATE_REK_FINISH, // baseline is ready
RESET_STATE_NORMAL_RUN, // normal run
RESET_STATE_INIT = 0xA0,
RESET_STATE_REK,
RESET_STATE_REK_FINISH,
RESET_STATE_NORMAL_RUN,
RESET_STATE_MAX = 0xAF
} RST_COMPLETE_STATE;
@ -137,12 +158,28 @@ typedef enum {
EVENT_MAP_RESET_COMPLETE = 0x60,
EVENT_MAP_FWINFO = 0x78,
EVENT_MAP_PROJECTID = 0x9A,
EVENT_MAP_FWDATE = 0x9C,
} I2C_EVENT_MAP;
//---extern structures---
#if NVT_TOUCH_MP_LENOVO
typedef enum {
MP_RESULT_SHIFT_SHORT = 0x00,
MP_RESULT_SHIFT_SHORT_DIFF,
MP_RESULT_SHIFT_SHORT_BASE,
MP_RESULT_SHIFT_OPEN,
MP_RESULT_SHIFT_RAWDATA,
MP_RESULT_SHIFT_CC,
MP_RESULT_SHIFT_CC_I,
MP_RESULT_SHIFT_CC_Q,
MP_RESULT_SHIFT_NOISE,
MP_RESULT_SHIFT_DIFF_MAX,
MP_RESULT_SHIFT_DIFF_MIN,
/* MP_RESULT_SHIFT_READFAIL,*/
} MP_TEST_RESULT;
#endif
extern struct nvt_ts_data *ts;
//---extern functions---
extern int32_t CTP_I2C_READ(struct i2c_client *client, uint16_t address, uint8_t *buf, uint16_t len);
extern int32_t CTP_I2C_WRITE(struct i2c_client *client, uint16_t address, uint8_t *buf, uint16_t len);
extern void nvt_bootloader_reset(void);
@ -151,9 +188,9 @@ extern int32_t nvt_check_fw_reset_state(RST_COMPLETE_STATE check_reset_state);
extern int32_t nvt_get_fw_info(void);
extern int32_t nvt_clear_fw_status(void);
extern int32_t nvt_check_fw_status(void);
#if NVT_TOUCH_ESD_PROTECT
extern void nvt_esd_check_enable(uint8_t enable);
#endif /* #if NVT_TOUCH_ESD_PROTECT */
extern void nvt_stop_crc_reboot(void);
#endif
#endif /* _LINUX_NVT_TOUCH_H */

View file

@ -1,8 +1,8 @@
/*
* Copyright (C) 2010 - 2017 Novatek, Inc.
*
* $Revision: 20251 $
* $Date: 2017-12-13 17:41:29 +0800 (Wed, 13 Dec 2017) $
* $Revision: 15382 $
* $Date: 2017-08-15 09:19:01 +0800 (周二, 15 八月 2017) $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -37,11 +37,12 @@
#define HANDSHAKING_HOST_READY 0xBB
#define XDATA_SECTOR_SIZE 256
#define XDATA_BUF_SIZE 2048
static uint8_t xdata_tmp[2048] = {0};
static int32_t xdata[2048] = {0};
static int32_t xdata_i[2048] = {0};
static int32_t xdata_q[2048] = {0};
static uint8_t xdata_tmp[XDATA_BUF_SIZE] = {0};
static int32_t xdata[XDATA_BUF_SIZE] = {0};
static int32_t xdata_i[XDATA_BUF_SIZE] = {0};
static int32_t xdata_q[XDATA_BUF_SIZE] = {0};
static struct proc_dir_entry *NVT_proc_fw_version_entry;
static struct proc_dir_entry *NVT_proc_baseline_entry;
@ -59,13 +60,11 @@ void nvt_change_mode(uint8_t mode)
{
uint8_t buf[8] = {0};
//---set xdata index to EVENT BUF ADDR---
buf[0] = 0xFF;
buf[1] = (ts->mmap->EVENT_BUF_ADDR >> 16) & 0xFF;
buf[2] = (ts->mmap->EVENT_BUF_ADDR >> 8) & 0xFF;
CTP_I2C_WRITE(ts->client, I2C_FW_Address, buf, 3);
//---set mode---
buf[0] = EVENT_MAP_HOST_CMD;
buf[1] = mode;
CTP_I2C_WRITE(ts->client, I2C_FW_Address, buf, 2);
@ -89,22 +88,86 @@ uint8_t nvt_get_fw_pipe(void)
{
uint8_t buf[8] = {0};
//---set xdata index to EVENT BUF ADDR---
buf[0] = 0xFF;
buf[1] = (ts->mmap->EVENT_BUF_ADDR >> 16) & 0xFF;
buf[2] = (ts->mmap->EVENT_BUF_ADDR >> 8) & 0xFF;
CTP_I2C_WRITE(ts->client, I2C_FW_Address, buf, 3);
//---read fw status---
buf[0] = EVENT_MAP_HANDSHAKING_or_SUB_CMD_BYTE;
buf[1] = 0x00;
CTP_I2C_READ(ts->client, I2C_FW_Address, buf, 2);
//NVT_LOG("FW pipe=%d, buf[1]=0x%02X\n", (buf[1]&0x01), buf[1]);
return (buf[1] & 0x01);
}
/*******************************************************
Description:
Novatek touchscreen read mass data function.
return:
n.a.
*******************************************************/
int32_t nvt_read_mass_data(uint8_t i2c_addr, uint8_t *temp_buf, uint32_t count)
{
int32_t i = 0;
int32_t j = 0;
int32_t k = 0;
uint8_t i2c_buf[I2C_TANSFER_LENGTH + 1] = {0};
uint32_t xdata_addr = 0;
uint32_t head_addr = 0;
int32_t dummy_len = 0;
int32_t data_len = 0;
int32_t residual_len = 0;
xdata_addr = (temp_buf[3] << 24) + (temp_buf[4] << 16) + (temp_buf[5] << 8) + temp_buf[6];
head_addr = xdata_addr - (xdata_addr % XDATA_SECTOR_SIZE);
dummy_len = xdata_addr - head_addr;
data_len = (int32_t)((temp_buf[1] << 8) + temp_buf[2]);
residual_len = (head_addr + dummy_len + data_len) % XDATA_SECTOR_SIZE;
if (data_len > XDATA_BUF_SIZE)
return -EINVAL;
for (i = 0; i < ((dummy_len + data_len) / XDATA_SECTOR_SIZE); i++) {
i2c_buf[0] = 0xFF;
i2c_buf[1] = ((head_addr + XDATA_SECTOR_SIZE * i) >> 16) & 0xFF;
i2c_buf[2] = ((head_addr + XDATA_SECTOR_SIZE * i) >> 8) & 0xFF;
CTP_I2C_WRITE(ts->client, (uint16_t)i2c_addr, i2c_buf, 3);
for (j = 0; j < (XDATA_SECTOR_SIZE / I2C_TANSFER_LENGTH); j++) {
i2c_buf[0] = I2C_TANSFER_LENGTH * j;
CTP_I2C_READ(ts->client, (uint16_t)i2c_addr, i2c_buf, I2C_TANSFER_LENGTH + 1);
for (k = 0; k < I2C_TANSFER_LENGTH; k++) {
xdata_tmp[XDATA_SECTOR_SIZE * i + I2C_TANSFER_LENGTH * j + k] = i2c_buf[k + 1];
}
}
}
if (residual_len != 0) {
i2c_buf[0] = 0xFF;
i2c_buf[1] = ((xdata_addr + data_len - residual_len) >> 16) & 0xFF;
i2c_buf[2] = ((xdata_addr + data_len - residual_len) >> 8) & 0xFF;
CTP_I2C_WRITE(ts->client, (uint16_t)i2c_addr, i2c_buf, 3);
for (j = 0; j < (residual_len / I2C_TANSFER_LENGTH + 1); j++) {
i2c_buf[0] = I2C_TANSFER_LENGTH * j;
CTP_I2C_READ(ts->client, (uint16_t)i2c_addr, i2c_buf, I2C_TANSFER_LENGTH + 1);
for (k = 0; k < I2C_TANSFER_LENGTH; k++) {
xdata_tmp[(dummy_len + data_len - residual_len) + I2C_TANSFER_LENGTH * j + k] = i2c_buf[k + 1];
}
}
}
i2c_buf[0] = 0xFF;
i2c_buf[1] = (ts->mmap->EVENT_BUF_ADDR >> 16) & 0xFF;
i2c_buf[2] = (ts->mmap->EVENT_BUF_ADDR >> 8) & 0xFF;
CTP_I2C_WRITE(ts->client, (uint16_t)i2c_addr, i2c_buf, 3);
for (i = 0; i < data_len; i++) {
*(temp_buf + i) = xdata_tmp[dummy_len + i];
}
return data_len;
}
/*******************************************************
Description:
Novatek touchscreen read meta data function.
@ -123,84 +186,61 @@ void nvt_read_mdata(uint32_t xdata_addr, uint32_t xdata_btn_addr)
int32_t data_len = 0;
int32_t residual_len = 0;
//---set xdata sector address & length---
head_addr = xdata_addr - (xdata_addr % XDATA_SECTOR_SIZE);
dummy_len = xdata_addr - head_addr;
data_len = ts->x_num * ts->y_num * 2;
residual_len = (head_addr + dummy_len + data_len) % XDATA_SECTOR_SIZE;
//printk("head_addr=0x%05X, dummy_len=0x%05X, data_len=0x%05X, residual_len=0x%05X\n", head_addr, dummy_len, data_len, residual_len);
//read xdata : step 1
for (i = 0; i < ((dummy_len + data_len) / XDATA_SECTOR_SIZE); i++) {
//---change xdata index---
buf[0] = 0xFF;
buf[1] = ((head_addr + XDATA_SECTOR_SIZE * i) >> 16) & 0xFF;
buf[2] = ((head_addr + XDATA_SECTOR_SIZE * i) >> 8) & 0xFF;
CTP_I2C_WRITE(ts->client, I2C_FW_Address, buf, 3);
//---read xdata by I2C_TANSFER_LENGTH
for (j = 0; j < (XDATA_SECTOR_SIZE / I2C_TANSFER_LENGTH); j++) {
//---read data---
buf[0] = I2C_TANSFER_LENGTH * j;
CTP_I2C_READ(ts->client, I2C_FW_Address, buf, I2C_TANSFER_LENGTH + 1);
//---copy buf to xdata_tmp---
for (k = 0; k < I2C_TANSFER_LENGTH; k++) {
xdata_tmp[XDATA_SECTOR_SIZE * i + I2C_TANSFER_LENGTH * j + k] = buf[k + 1];
//printk("0x%02X, 0x%04X\n", buf[k+1], (XDATA_SECTOR_SIZE*i + I2C_TANSFER_LENGTH*j + k));
}
}
//printk("addr=0x%05X\n", (head_addr+XDATA_SECTOR_SIZE*i));
}
//read xdata : step2
if (residual_len != 0) {
//---change xdata index---
buf[0] = 0xFF;
buf[1] = ((xdata_addr + data_len - residual_len) >> 16) & 0xFF;
buf[2] = ((xdata_addr + data_len - residual_len) >> 8) & 0xFF;
CTP_I2C_WRITE(ts->client, I2C_FW_Address, buf, 3);
//---read xdata by I2C_TANSFER_LENGTH
for (j = 0; j < (residual_len / I2C_TANSFER_LENGTH + 1); j++) {
//---read data---
buf[0] = I2C_TANSFER_LENGTH * j;
CTP_I2C_READ(ts->client, I2C_FW_Address, buf, I2C_TANSFER_LENGTH + 1);
//---copy buf to xdata_tmp---
for (k = 0; k < I2C_TANSFER_LENGTH; k++) {
xdata_tmp[(dummy_len + data_len - residual_len) + I2C_TANSFER_LENGTH * j + k] = buf[k + 1];
//printk("0x%02X, 0x%04x\n", buf[k+1], ((dummy_len+data_len-residual_len) + I2C_TANSFER_LENGTH*j + k));
}
}
//printk("addr=0x%05X\n", (xdata_addr+data_len-residual_len));
}
//---remove dummy data and 2bytes-to-1data---
for (i = 0; i < (data_len / 2); i++) {
xdata[i] = (int16_t)(xdata_tmp[dummy_len + i * 2] + 256 * xdata_tmp[dummy_len + i * 2 + 1]);
}
#if TOUCH_KEY_NUM > 0
//read button xdata : step3
//---change xdata index---
buf[0] = 0xFF;
buf[1] = (xdata_btn_addr >> 16) & 0xFF;
buf[2] = ((xdata_btn_addr >> 8) & 0xFF);
CTP_I2C_WRITE(ts->client, I2C_FW_Address, buf, 3);
//---read data---
buf[0] = (xdata_btn_addr & 0xFF);
CTP_I2C_READ(ts->client, I2C_FW_Address, buf, (TOUCH_KEY_NUM * 2 + 1));
//---2bytes-to-1data---
for (i = 0; i < TOUCH_KEY_NUM; i++) {
xdata[ts->x_num * ts->y_num + i] = (int16_t)(buf[1 + i * 2] + 256 * buf[1 + i * 2 + 1]);
}
#endif
//---set xdata index to EVENT BUF ADDR---
buf[0] = 0xFF;
buf[1] = (ts->mmap->EVENT_BUF_ADDR >> 16) & 0xFF;
buf[2] = (ts->mmap->EVENT_BUF_ADDR >> 8) & 0xFF;
@ -352,6 +392,36 @@ Description:
return:
n.a.
*******************************************************/
static int32_t nvt_info_open(struct inode *inode, struct file *file)
{
if (mutex_lock_interruptible(&ts->lock)) {
return -ERESTARTSYS;
}
NVT_LOG("++\n");
#if NVT_TOUCH_ESD_PROTECT
nvt_esd_check_enable(false);
#endif
if (nvt_get_fw_info()) {
mutex_unlock(&ts->lock);
return -EAGAIN;
}
mutex_unlock(&ts->lock);
NVT_LOG("--\n");
return seq_open(file, &nvt_fw_version_seq_ops);
}
static const struct file_operations nvt_info_proc_fops = {
.owner = THIS_MODULE,
.open = nvt_info_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
static int32_t nvt_fw_version_open(struct inode *inode, struct file *file)
{
if (mutex_lock_interruptible(&ts->lock)) {
@ -359,11 +429,9 @@ static int32_t nvt_fw_version_open(struct inode *inode, struct file *file)
}
NVT_LOG("++\n");
#if NVT_TOUCH_ESD_PROTECT
nvt_esd_check_enable(false);
#endif /* #if NVT_TOUCH_ESD_PROTECT */
nvt_esd_check_enable(false);
#endif
if (nvt_get_fw_info()) {
mutex_unlock(&ts->lock);
return -EAGAIN;
@ -398,11 +466,9 @@ static int32_t nvt_baseline_open(struct inode *inode, struct file *file)
}
NVT_LOG("++\n");
#if NVT_TOUCH_ESD_PROTECT
nvt_esd_check_enable(false);
#endif /* #if NVT_TOUCH_ESD_PROTECT */
nvt_esd_check_enable(false);
#endif
if (nvt_clear_fw_status()) {
mutex_unlock(&ts->lock);
return -EAGAIN;
@ -458,11 +524,9 @@ static int32_t nvt_raw_open(struct inode *inode, struct file *file)
}
NVT_LOG("++\n");
#if NVT_TOUCH_ESD_PROTECT
nvt_esd_check_enable(false);
#endif /* #if NVT_TOUCH_ESD_PROTECT */
nvt_esd_check_enable(false);
#endif
if (nvt_clear_fw_status()) {
mutex_unlock(&ts->lock);
return -EAGAIN;
@ -525,11 +589,9 @@ static int32_t nvt_diff_open(struct inode *inode, struct file *file)
}
NVT_LOG("++\n");
#if NVT_TOUCH_ESD_PROTECT
nvt_esd_check_enable(false);
#endif /* #if NVT_TOUCH_ESD_PROTECT */
nvt_esd_check_enable(false);
#endif
if (nvt_clear_fw_status()) {
mutex_unlock(&ts->lock);
return -EAGAIN;

View file

@ -1,8 +1,8 @@
/*
* Copyright (C) 2010 - 2017 Novatek, Inc.
*
* $Revision: 20544 $
* $Date: 2017-12-20 11:08:15 +0800 (Wed, 20 Dec 2017) $
* $Revision: 12034 $
* $Date: 2017-05-04 17:49:58 +0800 (周四, 04 五月 2017) $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -21,7 +21,7 @@
#include "nt36xxx.h"
#if BOOT_UPDATE_FIRMWARE
#if (BOOT_UPDATE_FIRMWARE || NVT_TOUCH_FW)
#define FW_BIN_SIZE_116KB 118784
#define FW_BIN_SIZE FW_BIN_SIZE_116KB
@ -45,7 +45,7 @@ int32_t update_firmware_request(char *filename)
int32_t ret = 0;
if (NULL == filename) {
return -EPERM;
return -1;
}
NVT_LOG("filename is %s\n", filename);
@ -56,13 +56,11 @@ int32_t update_firmware_request(char *filename)
return ret;
}
// check bin file size (116kb)
if (fw_entry->size != FW_BIN_SIZE) {
NVT_ERR("bin file size not match. (%zu)\n", fw_entry->size);
return -EINVAL;
}
// check if FW version add FW version bar equals 0xFF
if (*(fw_entry->data + FW_BIN_VER_OFFSET) + *(fw_entry->data + FW_BIN_VER_BAR_OFFSET) != 0xFF) {
NVT_ERR("bin file FW_VER + FW_VER_BAR should be 0xFF!\n");
NVT_ERR("FW_VER=0x%02X, FW_VER_BAR=0x%02X\n", *(fw_entry->data+FW_BIN_VER_OFFSET), *(fw_entry->data+FW_BIN_VER_BAR_OFFSET));
@ -100,7 +98,6 @@ int32_t Check_FW_Ver(void)
uint8_t buf[16] = {0};
int32_t ret = 0;
//write i2c index to EVENT BUF ADDR
buf[0] = 0xFF;
buf[1] = (ts->mmap->EVENT_BUF_ADDR >> 16) & 0xFF;
buf[2] = (ts->mmap->EVENT_BUF_ADDR >> 8) & 0xFF;
@ -110,7 +107,6 @@ int32_t Check_FW_Ver(void)
return ret;
}
//read Firmware Version
buf[0] = EVENT_MAP_FWINFO;
buf[1] = 0x00;
buf[2] = 0x00;
@ -124,13 +120,11 @@ int32_t Check_FW_Ver(void)
NVT_LOG("Bin FW Ver = 0x%02X, FW ver Bar = 0x%02X\n",
fw_entry->data[FW_BIN_VER_OFFSET], fw_entry->data[FW_BIN_VER_BAR_OFFSET]);
// check IC FW_VER + FW_VER_BAR equals 0xFF or not, need to update if not
if ((buf[1] + buf[2]) != 0xFF) {
NVT_ERR("IC FW_VER + FW_VER_BAR not equals to 0xFF!\n");
return 0;
}
// compare IC and binary FW version
if (buf[1] == fw_entry->data[FW_BIN_VER_OFFSET])
return 1;
else
@ -150,7 +144,6 @@ int32_t Resume_PD(void)
int32_t ret = 0;
int32_t retry = 0;
// Resume Command
buf[0] = 0x00;
buf[1] = 0xAB;
ret = CTP_I2C_WRITE(ts->client, I2C_HW_Address, buf, 2);
@ -159,7 +152,6 @@ int32_t Resume_PD(void)
return ret;
}
// Check 0xAA (Resume Command)
retry = 0;
while (1) {
msleep(1);
@ -176,7 +168,7 @@ int32_t Resume_PD(void)
retry++;
if (unlikely(retry > 20)) {
NVT_ERR("Check 0xAA (Resume Command) error!! status=0x%02X\n", buf[1]);
return -EPERM;
return -1;
}
}
msleep(10);
@ -208,14 +200,13 @@ int32_t Check_CheckSum(void)
if (Resume_PD()) {
NVT_ERR("Resume PD error!!\n");
return -EPERM;
return -1;
}
fw_bin_size = fw_entry->size;
for (i = 0; i < BLOCK_64KB_NUM; i++) {
if (fw_bin_size > (i * SIZE_64KB)) {
// Calculate WR_Filechksum of each 64KB block
len_in_blk = min(fw_bin_size - i * SIZE_64KB, (size_t)SIZE_64KB);
WR_Filechksum[i] = i + 0x00 + 0x00 + (((len_in_blk - 1) >> 8) & 0xFF) + ((len_in_blk - 1) & 0xFF);
for (k = 0; k < len_in_blk; k++) {
@ -223,7 +214,6 @@ int32_t Check_CheckSum(void)
}
WR_Filechksum[i] = 65535 - WR_Filechksum[i] + 1;
// Fast Read Command
buf[0] = 0x00;
buf[1] = 0x07;
buf[2] = i;
@ -236,7 +226,6 @@ int32_t Check_CheckSum(void)
NVT_ERR("Fast Read Command error!!(%d)\n", ret);
return ret;
}
// Check 0xAA (Fast Read Command)
retry = 0;
while (1) {
msleep(80);
@ -253,10 +242,9 @@ int32_t Check_CheckSum(void)
retry++;
if (unlikely(retry > 5)) {
NVT_ERR("Check 0xAA (Fast Read Command) failed, buf[1]=0x%02X, retry=%d\n", buf[1], retry);
return -EPERM;
return -1;
}
}
// Read Checksum (write addr high byte & middle byte)
buf[0] = 0xFF;
buf[1] = XDATA_Addr >> 16;
buf[2] = (XDATA_Addr >> 8) & 0xFF;
@ -265,7 +253,6 @@ int32_t Check_CheckSum(void)
NVT_ERR("Read Checksum (write addr high byte & middle byte) error!!(%d)\n", ret);
return ret;
}
// Read Checksum
buf[0] = (XDATA_Addr) & 0xFF;
buf[1] = 0x00;
buf[2] = 0x00;
@ -302,10 +289,8 @@ int32_t Init_BootLoader(void)
int32_t ret = 0;
int32_t retry = 0;
// SW Reset & Idle
nvt_sw_reset_idle();
// Initiate Flash Block
buf[0] = 0x00;
buf[1] = 0x00;
buf[2] = I2C_FW_Address;
@ -315,7 +300,6 @@ int32_t Init_BootLoader(void)
return ret;
}
// Check 0xAA (Initiate Flash Block)
retry = 0;
while (1) {
msleep(1);
@ -332,7 +316,7 @@ int32_t Init_BootLoader(void)
retry++;
if (unlikely(retry > 20)) {
NVT_ERR("Check 0xAA (Inittial Flash Block) error!! status=0x%02X\n", buf[1]);
return -EPERM;
return -1;
}
}
@ -358,7 +342,6 @@ int32_t Erase_Flash(void)
int32_t Flash_Address = 0;
int32_t retry = 0;
// Write Enable
buf[0] = 0x00;
buf[1] = 0x06;
ret = CTP_I2C_WRITE(ts->client, I2C_HW_Address, buf, 2);
@ -366,7 +349,6 @@ int32_t Erase_Flash(void)
NVT_ERR("Write Enable (for Write Status Register) error!!(%d)\n", ret);
return ret;
}
// Check 0xAA (Write Enable)
retry = 0;
while (1) {
mdelay(1);
@ -383,11 +365,10 @@ int32_t Erase_Flash(void)
retry++;
if (unlikely(retry > 20)) {
NVT_ERR("Check 0xAA (Write Enable for Write Status Register) error!! status=0x%02X\n", buf[1]);
return -EPERM;
return -1;
}
}
// Write Status Register
buf[0] = 0x00;
buf[1] = 0x01;
buf[2] = 0x00;
@ -396,7 +377,6 @@ int32_t Erase_Flash(void)
NVT_ERR("Write Status Register error!!(%d)\n", ret);
return ret;
}
// Check 0xAA (Write Status Register)
retry = 0;
while (1) {
mdelay(1);
@ -413,11 +393,10 @@ int32_t Erase_Flash(void)
retry++;
if (unlikely(retry > 20)) {
NVT_ERR("Check 0xAA (Write Status Register) error!! status=0x%02X\n", buf[1]);
return -EPERM;
return -1;
}
}
// Read Status
retry = 0;
while (1) {
mdelay(5);
@ -429,7 +408,6 @@ int32_t Erase_Flash(void)
return ret;
}
// Check 0xAA (Read Status)
buf[0] = 0x00;
buf[1] = 0x00;
buf[2] = 0x00;
@ -444,7 +422,7 @@ int32_t Erase_Flash(void)
retry++;
if (unlikely(retry > 100)) {
NVT_ERR("Check 0xAA (Read Status for Write Status Register) failed, buf[1]=0x%02X, buf[2]=0x%02X, retry=%d\n", buf[1], buf[2], retry);
return -EPERM;
return -1;
}
}
@ -454,7 +432,6 @@ int32_t Erase_Flash(void)
count = fw_entry->size / FLASH_SECTOR_SIZE;
for (i = 0; i < count; i++) {
// Write Enable
buf[0] = 0x00;
buf[1] = 0x06;
ret = CTP_I2C_WRITE(ts->client, I2C_HW_Address, buf, 2);
@ -462,7 +439,6 @@ int32_t Erase_Flash(void)
NVT_ERR("Write Enable error!!(%d,%d)\n", ret, i);
return ret;
}
// Check 0xAA (Write Enable)
retry = 0;
while (1) {
mdelay(1);
@ -479,15 +455,14 @@ int32_t Erase_Flash(void)
retry++;
if (unlikely(retry > 20)) {
NVT_ERR("Check 0xAA (Write Enable) error!! status=0x%02X\n", buf[1]);
return -EPERM;
return -1;
}
}
Flash_Address = i * FLASH_SECTOR_SIZE;
// Sector Erase
buf[0] = 0x00;
buf[1] = 0x20; // Command : Sector Erase
buf[1] = 0x20;
buf[2] = ((Flash_Address >> 16) & 0xFF);
buf[3] = ((Flash_Address >> 8) & 0xFF);
buf[4] = (Flash_Address & 0xFF);
@ -496,7 +471,6 @@ int32_t Erase_Flash(void)
NVT_ERR("Sector Erase error!!(%d,%d)\n", ret, i);
return ret;
}
// Check 0xAA (Sector Erase)
retry = 0;
while (1) {
mdelay(1);
@ -513,11 +487,10 @@ int32_t Erase_Flash(void)
retry++;
if (unlikely(retry > 20)) {
NVT_ERR("Check 0xAA (Sector Erase) failed, buf[1]=0x%02X, retry=%d\n", buf[1], retry);
return -EPERM;
return -1;
}
}
// Read Status
retry = 0;
while (1) {
mdelay(5);
@ -529,7 +502,6 @@ int32_t Erase_Flash(void)
return ret;
}
// Check 0xAA (Read Status)
buf[0] = 0x00;
buf[1] = 0x00;
buf[2] = 0x00;
@ -544,7 +516,7 @@ int32_t Erase_Flash(void)
retry++;
if (unlikely(retry > 100)) {
NVT_ERR("Check 0xAA (Read Status) failed, buf[1]=0x%02X, buf[2]=0x%02X, retry=%d\n", buf[1], buf[2], retry);
return -EPERM;
return -1;
}
}
}
@ -571,7 +543,6 @@ int32_t Write_Flash(void)
int32_t ret = 0;
int32_t retry = 0;
// change I2C buffer index
buf[0] = 0xFF;
buf[1] = XDATA_Addr >> 16;
buf[2] = (XDATA_Addr >> 8) & 0xFF;
@ -589,7 +560,6 @@ int32_t Write_Flash(void)
for (i = 0; i < count; i++) {
Flash_Address = i * 256;
// Write Enable
buf[0] = 0x00;
buf[1] = 0x06;
ret = CTP_I2C_WRITE(ts->client, I2C_HW_Address, buf, 2);
@ -597,7 +567,6 @@ int32_t Write_Flash(void)
NVT_ERR("Write Enable error!!(%d)\n", ret);
return ret;
}
// Check 0xAA (Write Enable)
retry = 0;
while (1) {
udelay(100);
@ -614,11 +583,10 @@ int32_t Write_Flash(void)
retry++;
if (unlikely(retry > 20)) {
NVT_ERR("Check 0xAA (Write Enable) error!! status=0x%02X\n", buf[1]);
return -EPERM;
return -1;
}
}
// Write Page : 256 bytes
for (j = 0; j < min(fw_entry->size - i * 256, (size_t)256); j += 32) {
buf[0] = (XDATA_Addr + j) & 0xFF;
for (k = 0; k < 32; k++) {
@ -640,7 +608,6 @@ int32_t Write_Flash(void)
tmpvalue = 255 - tmpvalue + 1;
// Page Program
buf[0] = 0x00;
buf[1] = 0x02;
buf[2] = ((Flash_Address >> 16) & 0xFF);
@ -654,7 +621,6 @@ int32_t Write_Flash(void)
NVT_ERR("Page Program error!!(%d), i=%d\n", ret, i);
return ret;
}
// Check 0xAA (Page Program)
retry = 0;
while (1) {
mdelay(1);
@ -671,15 +637,14 @@ int32_t Write_Flash(void)
retry++;
if (unlikely(retry > 20)) {
NVT_ERR("Check 0xAA (Page Program) failed, buf[1]=0x%02X, retry=%d\n", buf[1], retry);
return -EPERM;
return -1;
}
}
if (buf[1] == 0xEA) {
NVT_ERR("Page Program error!! i=%d\n", i);
return -ESRCH;
return -3;
}
// Read Status
retry = 0;
while (1) {
mdelay(5);
@ -691,7 +656,6 @@ int32_t Write_Flash(void)
return ret;
}
// Check 0xAA (Read Status)
buf[0] = 0x00;
buf[1] = 0x00;
buf[2] = 0x00;
@ -706,12 +670,12 @@ int32_t Write_Flash(void)
retry++;
if (unlikely(retry > 100)) {
NVT_ERR("Check 0xAA (Read Status) failed, buf[1]=0x%02X, buf[2]=0x%02X, retry=%d\n", buf[1], buf[2], retry);
return -EPERM;
return -1;
}
}
if (buf[1] == 0xEA) {
NVT_ERR("Page Program error!! i=%d\n", i);
return -EINTR;
return -4;
}
NVT_LOG("Programming...%2d%%\r", ((i * 100) / count));
@ -747,7 +711,6 @@ int32_t Verify_Flash(void)
for (i = 0; i < BLOCK_64KB_NUM; i++) {
if (fw_bin_size > (i * SIZE_64KB)) {
// Calculate WR_Filechksum of each 64KB block
len_in_blk = min(fw_bin_size - i * SIZE_64KB, (size_t)SIZE_64KB);
WR_Filechksum[i] = i + 0x00 + 0x00 + (((len_in_blk - 1) >> 8) & 0xFF) + ((len_in_blk - 1) & 0xFF);
for (k = 0; k < len_in_blk; k++) {
@ -755,7 +718,6 @@ int32_t Verify_Flash(void)
}
WR_Filechksum[i] = 65535 - WR_Filechksum[i] + 1;
// Fast Read Command
buf[0] = 0x00;
buf[1] = 0x07;
buf[2] = i;
@ -768,7 +730,6 @@ int32_t Verify_Flash(void)
NVT_ERR("Fast Read Command error!!(%d)\n", ret);
return ret;
}
// Check 0xAA (Fast Read Command)
retry = 0;
while (1) {
msleep(80);
@ -785,10 +746,9 @@ int32_t Verify_Flash(void)
retry++;
if (unlikely(retry > 5)) {
NVT_ERR("Check 0xAA (Fast Read Command) failed, buf[1]=0x%02X, retry=%d\n", buf[1], retry);
return -EPERM;
return -1;
}
}
// Read Checksum (write addr high byte & middle byte)
buf[0] = 0xFF;
buf[1] = XDATA_Addr >> 16;
buf[2] = (XDATA_Addr >> 8) & 0xFF;
@ -797,7 +757,6 @@ int32_t Verify_Flash(void)
NVT_ERR("Read Checksum (write addr high byte & middle byte) error!!(%d)\n", ret);
return ret;
}
// Read Checksum
buf[0] = (XDATA_Addr) & 0xFF;
buf[1] = 0x00;
buf[2] = 0x00;
@ -811,7 +770,7 @@ int32_t Verify_Flash(void)
if (WR_Filechksum[i] != RD_Filechksum[i]) {
NVT_ERR("Verify Fail%d!!\n", i);
NVT_ERR("RD_Filechksum[%d]=0x%04X, WR_Filechksum[%d]=0x%04X\n", i, RD_Filechksum[i], i, WR_Filechksum[i]);
return -EPERM;
return -1;
}
}
}
@ -831,144 +790,39 @@ int32_t Update_Firmware(void)
{
int32_t ret = 0;
//---Stop CRC check to prevent IC auto reboot---
nvt_stop_crc_reboot();
// Step 1 : initial bootloader
ret = Init_BootLoader();
if (ret) {
return ret;
}
// Step 2 : Resume PD
ret = Resume_PD();
if (ret) {
return ret;
}
// Step 3 : Erase
ret = Erase_Flash();
if (ret) {
return ret;
}
// Step 4 : Program
ret = Write_Flash();
if (ret) {
return ret;
}
// Step 5 : Verify
ret = Verify_Flash();
if (ret) {
return ret;
}
//Step 6 : Bootloader Reset
nvt_bootloader_reset();
nvt_check_fw_reset_state(RESET_STATE_INIT);
return ret;
}
#endif
/*******************************************************
Description:
Novatek touchscreen check flash end flag function.
return:
Executive outcomes. 0---succeed. 1,negative---failed.
*******************************************************/
#define NVT_FLASH_END_FLAG_LEN 3
#define NVT_FLASH_END_FLAG_ADDR 0x1AFFD
int32_t nvt_check_flash_end_flag(void)
{
uint8_t buf[8] = {0};
uint8_t nvt_end_flag[NVT_FLASH_END_FLAG_LEN + 1] = {0};
int32_t ret = 0;
// Step 1 : initial bootloader
ret = Init_BootLoader();
if (ret) {
return ret;
}
// Step 2 : Resume PD
ret = Resume_PD();
if (ret) {
return ret;
}
// Step 3 : unlock
buf[0] = 0x00;
buf[1] = 0x35;
ret = CTP_I2C_WRITE(ts->client, I2C_HW_Address, buf, 2);
if (ret < 0) {
NVT_ERR("write unlock error!!(%d)\n", ret);
return ret;
}
msleep(10);
//Step 4 : Flash Read Command
buf[0] = 0x00;
buf[1] = 0x03;
buf[2] = (NVT_FLASH_END_FLAG_ADDR >> 16) & 0xFF; //Addr_H
buf[3] = (NVT_FLASH_END_FLAG_ADDR >> 8) & 0xFF; //Addr_M
buf[4] = NVT_FLASH_END_FLAG_ADDR & 0xFF; //Addr_L
buf[5] = (NVT_FLASH_END_FLAG_LEN >> 8) & 0xFF; //Len_H
buf[6] = NVT_FLASH_END_FLAG_LEN & 0xFF; //Len_L
ret = CTP_I2C_WRITE(ts->client, I2C_HW_Address, buf, 7);
if (ret < 0) {
NVT_ERR("write Read Command error!!(%d)\n", ret);
return ret;
}
msleep(10);
// Check 0xAA (Read Command)
buf[0] = 0x00;
buf[1] = 0x00;
ret = CTP_I2C_READ(ts->client, I2C_HW_Address, buf, 2);
if (ret < 0) {
NVT_ERR("Check 0xAA (Read Command) error!!(%d)\n", ret);
return ret;
}
if (buf[1] != 0xAA) {
NVT_ERR("Check 0xAA (Read Command) error!! status=0x%02X\n", buf[1]);
return -EPERM;
}
msleep(10);
//Step 5 : Read Flash Data
buf[0] = 0xFF;
buf[1] = (ts->mmap->READ_FLASH_CHECKSUM_ADDR >> 16) & 0xFF;
buf[2] = (ts->mmap->READ_FLASH_CHECKSUM_ADDR >> 8) & 0xFF;
ret = CTP_I2C_WRITE(ts->client, I2C_BLDR_Address, buf, 3);
if (ret < 0) {
NVT_ERR("change index error!! (%d)\n", ret);
return ret;
}
msleep(10);
// Read Back
buf[0] = ts->mmap->READ_FLASH_CHECKSUM_ADDR & 0xFF;
ret = CTP_I2C_READ(ts->client, I2C_BLDR_Address, buf, 6);
if (ret < 0) {
NVT_ERR("Read Back error!! (%d)\n", ret);
return ret;
}
//buf[3:5] => NVT End Flag
strlcpy(nvt_end_flag, &buf[3], sizeof(nvt_end_flag));
NVT_LOG("nvt_end_flag=%s (%02X %02X %02X)\n", nvt_end_flag, buf[3], buf[4], buf[5]);
if (strncmp(nvt_end_flag, "NVT", 3) == 0) {
return 0;
} else {
NVT_ERR("\"NVT\" end flag not found!\n");
return 1;
}
}
#if BOOT_UPDATE_FIRMWARE
/*******************************************************
Description:
Novatek touchscreen update firmware when booting
@ -982,9 +836,8 @@ 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);
sprintf(firmware_name, BOOT_UPDATE_FIRMWARE_NAME);
// request bin file in "/etc/firmware"
ret = update_firmware_request(firmware_name);
if (ret) {
NVT_ERR("update_firmware_request failed. (%d)\n", ret);
@ -992,36 +845,386 @@ void Boot_Update_Firmware(struct work_struct *work)
}
mutex_lock(&ts->lock);
#if NVT_TOUCH_ESD_PROTECT
nvt_esd_check_enable(false);
#endif /* #if NVT_TOUCH_ESD_PROTECT */
#endif
#if NVT_TOUCH_FW
ts->loading_fw = 1;
#endif
nvt_sw_reset_idle();
ret = Check_CheckSum();
if (ret < 0) { // read firmware checksum failed
if (ret < 0) {
NVT_ERR("read firmware checksum failed\n");
Update_Firmware();
} else if ((ret == 0) && (Check_FW_Ver() == 0)) { // (fw checksum not match) && (bin fw version >= ic fw version)
} else if ((ret == 0) && (Check_FW_Ver() == 0)) {
NVT_LOG("firmware version not match\n");
Update_Firmware();
} else if (nvt_check_flash_end_flag()) {
NVT_LOG("check flash end flag failed\n");
Update_Firmware();
} else {
// Bootloader Reset
nvt_bootloader_reset();
ret = nvt_check_fw_reset_state(RESET_STATE_INIT);
if (ret) {
NVT_LOG("check fw reset state failed\n");
Update_Firmware();
}
nvt_check_fw_reset_state(RESET_STATE_INIT);
}
#if NVT_TOUCH_FW
ts->loading_fw = 0;
#endif
mutex_unlock(&ts->lock);
update_firmware_release();
}
#endif /* BOOT_UPDATE_FIRMWARE */
#if NVT_TOUCH_FW
static ssize_t nvt_poweron_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
bool val;
mutex_lock(&ts->lock);
val = ts->suspended;
mutex_unlock(&ts->lock);
return scnprintf(buf, PAGE_SIZE, "%d\n",
val == 0);
}
static DEVICE_ATTR(poweron, 0444, nvt_poweron_show, NULL);
static ssize_t nvt_ic_ver_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return scnprintf(buf, PAGE_SIZE, "[FW]%02x,[IC]NT36525\n",
ts->fw_ver);
}
static DEVICE_ATTR(ic_ver, 0444, nvt_ic_ver_show, NULL);
static ssize_t nvt_productinfo_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
/* Update script use as $touch_product_id in fw name ==> (chip id from Lenovo&script) OR (vendor name from Focaltech) OR (project ID from Longcheer&Himax)
Project ID ?? ( - Jeter - Hannah)
Chip ID ?? (NVT-ts or NVTCapacitiveTouchScreen or NT36xxx) */
return scnprintf(buf, PAGE_SIZE, "%s\n",
ts->product_id);
}
static DEVICE_ATTR(productinfo, 0444, nvt_productinfo_show, NULL);
static ssize_t nvt_force_reflash_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
unsigned int input;
if (sscanf(buf, "%u", &input) != 1)
return -EINVAL;
ts->force_reflash = (input == 0) ? false : true;
return count;
}
static DEVICE_ATTR(forcereflash, 0220, NULL, nvt_force_reflash_store);
static ssize_t nvt_flashprog_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return scnprintf(buf, PAGE_SIZE, "%d\n",
(ts->loading_fw) ? 1 : 0);
}
static DEVICE_ATTR(flashprog, 0444, nvt_flashprog_show, NULL);
static ssize_t nvt_do_reflash_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
int retval;
char prefix[FW_NAME_MAX_LEN] = VENDOR_NAME;
char template[FW_NAME_MAX_LEN];
char firmware_name[256] = "";
if (count > FW_NAME_MAX_LEN) {
NVT_ERR("FW filename is too long\n");
retval = -EINVAL;
goto exit;
}
if (ts->suspended) {
NVT_ERR("In suspend state, try again later\n");
retval = -EINVAL;
goto exit;
}
if (ts->loading_fw) {
NVT_ERR("In FW flashing state, try again later\n");
retval = -EINVAL;
goto exit;
}
if (!ts->force_reflash) {
if (strncmp(buf, prefix,
strnlen(prefix, sizeof(prefix)))) {
NVT_ERR("FW does not belong to Novatek\n");
retval = -EINVAL;
goto exit;
}
snprintf(template, sizeof(template), "-%s-",
ts->product_id);
if (!strnstr(buf + strnlen(prefix, sizeof(prefix)), template,
count)) {
NVT_ERR("FW does not belong to %s\n", ts->product_id);
retval = -EINVAL;
goto exit;
}
}
strlcpy(firmware_name, buf, count);
NVT_LOG("FW filename: %s\n", firmware_name);
retval = update_firmware_request(firmware_name);
if (retval) {
NVT_ERR("update_firmware_request failed. (%d)\n", retval);
goto exit;
}
mutex_lock(&ts->lock);
#if NVT_TOUCH_ESD_PROTECT
nvt_esd_check_enable(false);
#endif
ts->loading_fw = 1;
nvt_sw_reset_idle();
retval = Check_CheckSum();
if (retval < 0) {
NVT_ERR("read firmware checksum failed\n");
Update_Firmware();
} else if ((retval == 0) && (Check_FW_Ver() == 0)) {
NVT_LOG("firmware version not match\n");
Update_Firmware();
} else {
/* Bootloader Reset */
nvt_bootloader_reset();
nvt_check_fw_reset_state(RESET_STATE_INIT);
}
ts->loading_fw = 0;
mutex_unlock(&ts->lock);
update_firmware_release();
retval = count;
exit:
return retval;
}
static DEVICE_ATTR(doreflash, 0220, NULL, nvt_do_reflash_store);
static ssize_t nvt_build_id_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
/* Update script use for comparing $str_cfg_id_latest in fw name */
uint8_t tmp_buf[4] = {0};
uint8_t fw_version = 0;
uint8_t date_Y = 0;
uint8_t date_M = 0;
uint8_t date_D = 0;
tmp_buf[0] = 0xFF;
tmp_buf[1] = (ts->mmap->EVENT_BUF_ADDR >> 16) & 0xFF;
tmp_buf[2] = (ts->mmap->EVENT_BUF_ADDR >> 8) & 0xFF;
CTP_I2C_WRITE(ts->client, I2C_FW_Address, tmp_buf, 3);
tmp_buf[0] = EVENT_MAP_FWINFO;
CTP_I2C_READ(ts->client, I2C_FW_Address, tmp_buf, 2);
fw_version = tmp_buf[1];
tmp_buf[0] = EVENT_MAP_FWDATE;
CTP_I2C_READ(ts->client, I2C_FW_Address, tmp_buf, 4);
date_Y = tmp_buf[1];
date_M = tmp_buf[2];
date_D = tmp_buf[3];
return scnprintf(buf, PAGE_SIZE, "%02x-%02d%02d%02d\n",
fw_version, date_Y, date_M, date_D);
}
static DEVICE_ATTR(buildid, 0444, nvt_build_id_show, NULL);
#include <linux/slab.h>
#include <linux/major.h>
#include <linux/kdev_t.h>
/* Attribute: path (RO) */
static ssize_t path_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
ssize_t blen;
const char *path;
path = kobject_get_path(&ts->client->dev.kobj, GFP_KERNEL);
blen = scnprintf(buf, PAGE_SIZE, "%s", path ? path : "na");
kfree(path);
return blen;
}
/* Attribute: vendor (RO) */
static ssize_t vendor_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return scnprintf(buf, PAGE_SIZE, VENDOR_NAME);
}
static struct device_attribute touchscreen_attributes[] = {
__ATTR_RO(path),
__ATTR_RO(vendor),
__ATTR_NULL
};
#define TSDEV_MINOR_BASE 128
#define TSDEV_MINOR_MAX 32
/*******************************************************
Description:
Novatek touchscreen FW function class. file node
initial function.
return:
Executive outcomes. 0---succeed. -1---failed.
*******************************************************/
int32_t nvt_fw_class_init(bool create)
{
struct device_attribute *attrs = touchscreen_attributes;
int i, error = 0;
static struct class *touchscreen_class;
static struct device *ts_class_dev;
static int minor;
if (create) {
minor = input_get_new_minor(ts->client->addr,
1, false);
if (minor < 0)
minor = input_get_new_minor(TSDEV_MINOR_BASE,
TSDEV_MINOR_MAX, true);
NVT_LOG("assigned minor %d\n", minor);
touchscreen_class = class_create(THIS_MODULE, "touchscreen");
if (IS_ERR(touchscreen_class)) {
error = PTR_ERR(touchscreen_class);
touchscreen_class = NULL;
return error;
}
ts_class_dev = device_create(touchscreen_class, NULL,
MKDEV(INPUT_MAJOR, minor),
ts, NVT_I2C_NAME);
if (IS_ERR(ts_class_dev)) {
error = PTR_ERR(ts_class_dev);
ts_class_dev = NULL;
return error;
}
for (i = 0; attrs[i].attr.name != NULL; ++i) {
error = device_create_file(ts_class_dev, &attrs[i]);
if (error)
break;
}
if (error)
goto device_destroy;
else
NVT_LOG("create /sys/class/touchscreen/%s Succeeded!\n", NVT_I2C_NAME);
} else {
if (!touchscreen_class || !ts_class_dev)
return -ENODEV;
for (i = 0; attrs[i].attr.name != NULL; ++i)
device_remove_file(ts_class_dev, &attrs[i]);
device_unregister(ts_class_dev);
class_unregister(touchscreen_class);
}
return 0;
device_destroy:
for (--i; i >= 0; --i)
device_remove_file(ts_class_dev, &attrs[i]);
device_destroy(touchscreen_class, MKDEV(INPUT_MAJOR, minor));
ts_class_dev = NULL;
class_unregister(touchscreen_class);
NVT_ERR("error creating touchscreen class\n");
return -ENODEV;
}
int nvt_fw_sysfs_init(void)
{
int ret;
struct i2c_client *client = ts->client;
ret = nvt_fw_class_init(true);
if (ret != 0) {
NVT_ERR("fw class init failed. ret=%d\n", ret);
return ret;
}
ret = device_create_file(&client->dev, &dev_attr_forcereflash);
if (ret) {
NVT_ERR("create_file dev_attr_forcereflash failed\n");
return ret;
}
ret = device_create_file(&client->dev, &dev_attr_flashprog);
if (ret) {
NVT_ERR("create_file dev_attr_flashprog failed\n");
return ret;
}
ret = device_create_file(&client->dev, &dev_attr_doreflash);
if (ret) {
NVT_ERR("create_file dev_attr_doreflash failed\n");
return ret;
}
ret = device_create_file(&client->dev, &dev_attr_buildid);
if (ret) {
NVT_ERR("create_file dev_attr_buildid failed\n");
return ret;
}
ret = device_create_file(&client->dev, &dev_attr_productinfo);
if (ret) {
NVT_ERR("create_file dev_attr_productinfo failed\n");
return ret;
}
ret = device_create_file(&client->dev, &dev_attr_poweron);
if (ret) {
NVT_ERR("create_file dev_attr_poweron failed\n");
return ret;
}
ret = device_create_file(&client->dev, &dev_attr_ic_ver);
if (ret) {
NVT_ERR("create_file dev_attr_ic_ver failed\n");
return ret;
}
return 0;
}
void nvt_fw_sysfs_deinit(void)
{
struct i2c_client *client = ts->client;
device_remove_file(&client->dev, &dev_attr_forcereflash);
device_remove_file(&client->dev, &dev_attr_flashprog);
device_remove_file(&client->dev, &dev_attr_doreflash);
device_remove_file(&client->dev, &dev_attr_buildid);
device_remove_file(&client->dev, &dev_attr_productinfo);
device_remove_file(&client->dev, &dev_attr_poweron);
device_remove_file(&client->dev, &dev_attr_ic_ver);
nvt_fw_class_init(false);
}
#endif

View file

@ -1,208 +0,0 @@
/*
* Copyright (C) 2010 - 2017 Novatek, Inc.
*
* $Revision: 20544 $
* $Date: 2017-12-20 11:08:15 +0800 (Wed, 20 Dec 2017) $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*/
struct nvt_ts_mem_map {
uint32_t EVENT_BUF_ADDR;
uint32_t RAW_PIPE0_ADDR;
uint32_t RAW_PIPE0_Q_ADDR;
uint32_t RAW_PIPE1_ADDR;
uint32_t RAW_PIPE1_Q_ADDR;
uint32_t BASELINE_ADDR;
uint32_t BASELINE_Q_ADDR;
uint32_t BASELINE_BTN_ADDR;
uint32_t BASELINE_BTN_Q_ADDR;
uint32_t DIFF_PIPE0_ADDR;
uint32_t DIFF_PIPE0_Q_ADDR;
uint32_t DIFF_PIPE1_ADDR;
uint32_t DIFF_PIPE1_Q_ADDR;
uint32_t RAW_BTN_PIPE0_ADDR;
uint32_t RAW_BTN_PIPE0_Q_ADDR;
uint32_t RAW_BTN_PIPE1_ADDR;
uint32_t RAW_BTN_PIPE1_Q_ADDR;
uint32_t DIFF_BTN_PIPE0_ADDR;
uint32_t DIFF_BTN_PIPE0_Q_ADDR;
uint32_t DIFF_BTN_PIPE1_ADDR;
uint32_t DIFF_BTN_PIPE1_Q_ADDR;
uint32_t READ_FLASH_CHECKSUM_ADDR;
uint32_t RW_FLASH_DATA_ADDR;
};
static const struct nvt_ts_mem_map NT36672A_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 NT36772_memory_map = {
.EVENT_BUF_ADDR = 0x11E00,
.RAW_PIPE0_ADDR = 0x10000,
.RAW_PIPE0_Q_ADDR = 0,
.RAW_PIPE1_ADDR = 0x12000,
.RAW_PIPE1_Q_ADDR = 0,
.BASELINE_ADDR = 0x10E70,
.BASELINE_Q_ADDR = 0,
.BASELINE_BTN_ADDR = 0x12E70,
.BASELINE_BTN_Q_ADDR = 0,
.DIFF_PIPE0_ADDR = 0x10830,
.DIFF_PIPE0_Q_ADDR = 0,
.DIFF_PIPE1_ADDR = 0x12830,
.DIFF_PIPE1_Q_ADDR = 0,
.RAW_BTN_PIPE0_ADDR = 0x10E60,
.RAW_BTN_PIPE0_Q_ADDR = 0,
.RAW_BTN_PIPE1_ADDR = 0x12E60,
.RAW_BTN_PIPE1_Q_ADDR = 0,
.DIFF_BTN_PIPE0_ADDR = 0x10E68,
.DIFF_BTN_PIPE0_Q_ADDR = 0,
.DIFF_BTN_PIPE1_ADDR = 0x12E68,
.DIFF_BTN_PIPE1_Q_ADDR = 0,
.READ_FLASH_CHECKSUM_ADDR = 0x14000,
.RW_FLASH_DATA_ADDR = 0x14002,
};
static const struct nvt_ts_mem_map NT36525_memory_map = {
.EVENT_BUF_ADDR = 0x11A00,
.RAW_PIPE0_ADDR = 0x10000,
.RAW_PIPE0_Q_ADDR = 0,
.RAW_PIPE1_ADDR = 0x12000,
.RAW_PIPE1_Q_ADDR = 0,
.BASELINE_ADDR = 0x10B08,
.BASELINE_Q_ADDR = 0,
.BASELINE_BTN_ADDR = 0x12B08,
.BASELINE_BTN_Q_ADDR = 0,
.DIFF_PIPE0_ADDR = 0x1064C,
.DIFF_PIPE0_Q_ADDR = 0,
.DIFF_PIPE1_ADDR = 0x1264C,
.DIFF_PIPE1_Q_ADDR = 0,
.RAW_BTN_PIPE0_ADDR = 0x10634,
.RAW_BTN_PIPE0_Q_ADDR = 0,
.RAW_BTN_PIPE1_ADDR = 0x12634,
.RAW_BTN_PIPE1_Q_ADDR = 0,
.DIFF_BTN_PIPE0_ADDR = 0x10AFC,
.DIFF_BTN_PIPE0_Q_ADDR = 0,
.DIFF_BTN_PIPE1_ADDR = 0x12AFC,
.DIFF_BTN_PIPE1_Q_ADDR = 0,
.READ_FLASH_CHECKSUM_ADDR = 0x14000,
.RW_FLASH_DATA_ADDR = 0x14002,
};
static const struct nvt_ts_mem_map NT36870_memory_map = {
.EVENT_BUF_ADDR = 0x25000,
.RAW_PIPE0_ADDR = 0x20000,
.RAW_PIPE0_Q_ADDR = 0x204C8,
.RAW_PIPE1_ADDR = 0x23000,
.RAW_PIPE1_Q_ADDR = 0x234C8,
.BASELINE_ADDR = 0x21350,
.BASELINE_Q_ADDR = 0x21818,
.BASELINE_BTN_ADDR = 0x24350,
.BASELINE_BTN_Q_ADDR = 0x24358,
.DIFF_PIPE0_ADDR = 0x209B0,
.DIFF_PIPE0_Q_ADDR = 0x20E78,
.DIFF_PIPE1_ADDR = 0x239B0,
.DIFF_PIPE1_Q_ADDR = 0x23E78,
.RAW_BTN_PIPE0_ADDR = 0x20990,
.RAW_BTN_PIPE0_Q_ADDR = 0x20998,
.RAW_BTN_PIPE1_ADDR = 0x23990,
.RAW_BTN_PIPE1_Q_ADDR = 0x23998,
.DIFF_BTN_PIPE0_ADDR = 0x21340,
.DIFF_BTN_PIPE0_Q_ADDR = 0x21348,
.DIFF_BTN_PIPE1_ADDR = 0x24340,
.DIFF_BTN_PIPE1_Q_ADDR = 0x24348,
.READ_FLASH_CHECKSUM_ADDR = 0x24000,
.RW_FLASH_DATA_ADDR = 0x24002,
};
static const struct nvt_ts_mem_map NT36676F_memory_map = {
.EVENT_BUF_ADDR = 0x11A00,
.RAW_PIPE0_ADDR = 0x10000,
.RAW_PIPE0_Q_ADDR = 0,
.RAW_PIPE1_ADDR = 0x12000,
.RAW_PIPE1_Q_ADDR = 0,
.BASELINE_ADDR = 0x10B08,
.BASELINE_Q_ADDR = 0,
.BASELINE_BTN_ADDR = 0x12B08,
.BASELINE_BTN_Q_ADDR = 0,
.DIFF_PIPE0_ADDR = 0x1064C,
.DIFF_PIPE0_Q_ADDR = 0,
.DIFF_PIPE1_ADDR = 0x1264C,
.DIFF_PIPE1_Q_ADDR = 0,
.RAW_BTN_PIPE0_ADDR = 0x10634,
.RAW_BTN_PIPE0_Q_ADDR = 0,
.RAW_BTN_PIPE1_ADDR = 0x12634,
.RAW_BTN_PIPE1_Q_ADDR = 0,
.DIFF_BTN_PIPE0_ADDR = 0x10AFC,
.DIFF_BTN_PIPE0_Q_ADDR = 0,
.DIFF_BTN_PIPE1_ADDR = 0x12AFC,
.DIFF_BTN_PIPE1_Q_ADDR = 0,
.READ_FLASH_CHECKSUM_ADDR = 0x14000,
.RW_FLASH_DATA_ADDR = 0x14002,
};
#define NVT_ID_BYTE_MAX 6
struct nvt_ts_trim_id_table {
uint8_t id[NVT_ID_BYTE_MAX];
uint8_t mask[NVT_ID_BYTE_MAX];
const struct nvt_ts_mem_map *mmap;
uint8_t carrier_system;
};
static const struct nvt_ts_trim_id_table trim_id_table[] = {
{.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},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0x55, 0x72, 0xFF, 0x00, 0x00, 0x00}, .mask = {1, 1, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xAA, 0x00, 0xFF, 0x00, 0x00, 0x00}, .mask = {1, 1, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xAA, 0x72, 0xFF, 0x00, 0x00, 0x00}, .mask = {1, 1, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xFF, 0xFF, 0xFF, 0x72, 0x67, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xFF, 0xFF, 0xFF, 0x70, 0x66, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xFF, 0xFF, 0xFF, 0x70, 0x67, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xFF, 0xFF, 0xFF, 0x72, 0x66, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xFF, 0xFF, 0xFF, 0x25, 0x65, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36525_memory_map, .carrier_system = 0},
{.id = {0xFF, 0xFF, 0xFF, 0x70, 0x68, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36870_memory_map, .carrier_system = 1},
{.id = {0xFF, 0xFF, 0xFF, 0x76, 0x66, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36676F_memory_map, .carrier_system = 0}
};

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
/*
* Copyright (C) 2010 - 2017 Novatek, Inc.
*
* $Revision: 19587 $
* $Date: 2017-11-28 21:00:30 +0800 (Tue, 28 Nov 2017) $
* $Revision: 14590 $
* $Date: 2017-07-20 11:14:42 +0800 (周四, 20 七月 2017) $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -30,345 +30,130 @@ static uint8_t AIN_Y[40] = {31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19,
static uint8_t AIN_KEY[8] = {0, 1, 2, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
#endif /* #if TOUCH_KEY_NUM > 0 */
static int32_t PS_Config_Lmt_Short_Rawdata_P[40 * 40] = {
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000, 20000,
#if TOUCH_KEY_NUM > 0
20000, 20000, 20000,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_Short_Rawdata_N[40 * 40] = {
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550, 11550,
#if TOUCH_KEY_NUM > 0
11550, 11550, 11550,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_Short_Diff_P[40 * 40] = {
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300, 6300,
#if TOUCH_KEY_NUM > 0
6300, 6300, 6300,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_Short_Diff_N[40 * 40] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#if TOUCH_KEY_NUM > 0
0, 0, 0,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_Short_Base_P[40 * 40] = {
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
#if TOUCH_KEY_NUM > 0
2000, 2000, 2000,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_Short_Base_N[40 * 40] = {
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
-2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000, -2000,
#if TOUCH_KEY_NUM > 0
-2000, -2000, -2000,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_Short_Rawdata_P = 13500;
static int32_t PS_Config_Lmt_Short_Rawdata_N = 11500;
static int32_t PS_Config_Lmt_Key_Short_Rawdata_P = 20000;
static int32_t PS_Config_Lmt_Key_Short_Rawdata_N = 11550;
static int32_t PS_Config_Lmt_Short_Diff_P = 6300;
static int32_t PS_Config_Lmt_Short_Diff_N;
static int32_t PS_Config_Lmt_Key_Short_Diff_P = 6300;
static int32_t PS_Config_Lmt_Key_Short_Diff_N;
static int32_t PS_Config_Lmt_Short_Base_P = 2000;
static int32_t PS_Config_Lmt_Short_Base_N = -2000;
static int32_t PS_Config_Lmt_Key_Short_Base_P = 2000;
static int32_t PS_Config_Lmt_Key_Short_Base_N = -2000;
static int32_t PS_Config_Lmt_Open_Rawdata_P[40 * 40] = {
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000, 13000,
5149, 5167, 5201, 5164, 5204, 5167, 5201, 5177, 5233, 5217, 5168, 5193, 5161, 5187, 5161, 5190, 5154, 5145,
4926, 4937, 4968, 4929, 4970, 4933, 4967, 4942, 4998, 4986, 4936, 4964, 4933, 4962, 4933, 4965, 4927, 4929,
4901, 4907, 4937, 4898, 4936, 4901, 4934, 4908, 4965, 4959, 4910, 4936, 4905, 4936, 4905, 4936, 4902, 4904,
4865, 4868, 4901, 4862, 4898, 4865, 4896, 4871, 4927, 4901, 4852, 4877, 4848, 4877, 4846, 4876, 4845, 4842,
4860, 4865, 4895, 4858, 4892, 4861, 4892, 4867, 4921, 4911, 4864, 4887, 4860, 4889, 4858, 4886, 4855, 4852,
4862, 4870, 4898, 4862, 4895, 4865, 4895, 4873, 4924, 4905, 4860, 4882, 4855, 4882, 4854, 4880, 4852, 4845,
4860, 4867, 4893, 4861, 4890, 4864, 4889, 4868, 4920, 4904, 4861, 4880, 4855, 4880, 4855, 4879, 4852, 4842,
4858, 4867, 4890, 4861, 4887, 4862, 4887, 4868, 4917, 4902, 4861, 4877, 4855, 4879, 4854, 4876, 4854, 4839,
4854, 4864, 4885, 4858, 4882, 4860, 4880, 4864, 4910, 4905, 4865, 4879, 4858, 4880, 4858, 4877, 4858, 4842,
4867, 4877, 4895, 4871, 4893, 4873, 4892, 4877, 4923, 4907, 4867, 4879, 4861, 4879, 4860, 4877, 4861, 4840,
4858, 4870, 4887, 4862, 4885, 4865, 4883, 4870, 4914, 4899, 4861, 4871, 4855, 4873, 4854, 4870, 4855, 4835,
4857, 4867, 4885, 4861, 4882, 4864, 4882, 4867, 4911, 4902, 4864, 4874, 4857, 4877, 4855, 4873, 4858, 4837,
4858, 4870, 4886, 4864, 4885, 4865, 4883, 4870, 4914, 4896, 4860, 4870, 4854, 4871, 4851, 4867, 4854, 4832,
4855, 4867, 4883, 4862, 4880, 4862, 4880, 4867, 4911, 4902, 4864, 4874, 4858, 4876, 4857, 4871, 4858, 4836,
4855, 4867, 4883, 4861, 4880, 4864, 4880, 4867, 4911, 4892, 4855, 4864, 4848, 4867, 4848, 4862, 4851, 4826,
4852, 4864, 4882, 4860, 4879, 4861, 4877, 4864, 4907, 4895, 4858, 4867, 4852, 4870, 4851, 4865, 4854, 4829,
4846, 4864, 4883, 4861, 4879, 4861, 4879, 4864, 4908, 4885, 4854, 4864, 4849, 4865, 4848, 4864, 4851, 4827,
4843, 4858, 4877, 4855, 4871, 4855, 4871, 4858, 4901, 4895, 4862, 4871, 4858, 4874, 4855, 4873, 4861, 4835,
4849, 4862, 4882, 4860, 4876, 4860, 4877, 4862, 4907, 4885, 4851, 4860, 4846, 4862, 4843, 4861, 4851, 4824,
4836, 4849, 4868, 4848, 4864, 4848, 4864, 4852, 4895, 4883, 4851, 4858, 4846, 4862, 4843, 4861, 4849, 4823,
4839, 4852, 4870, 4849, 4865, 4851, 4865, 4852, 4895, 4880, 4848, 4855, 4843, 4860, 4840, 4858, 4848, 4820,
4840, 4854, 4871, 4851, 4865, 4851, 4867, 4854, 4896, 4877, 4846, 4854, 4840, 4857, 4839, 4857, 4846, 4818,
4826, 4839, 4857, 4836, 4851, 4836, 4852, 4839, 4882, 4871, 4840, 4848, 4836, 4852, 4833, 4851, 4842, 4812,
4830, 4845, 4862, 4843, 4857, 4842, 4857, 4845, 4887, 4864, 4835, 4842, 4830, 4845, 4827, 4845, 4836, 4807,
4827, 4842, 4860, 4839, 4852, 4839, 4854, 4842, 4885, 4862, 4832, 4839, 4827, 4842, 4824, 4842, 4835, 4804,
4821, 4836, 4852, 4833, 4846, 4833, 4848, 4836, 4879, 4864, 4835, 4842, 4829, 4843, 4827, 4845, 4837, 4808,
4821, 4837, 4855, 4835, 4848, 4833, 4848, 4836, 4879, 4858, 4830, 4837, 4826, 4840, 4824, 4842, 4836, 4804,
4818, 4833, 4852, 4830, 4845, 4830, 4846, 4833, 4876, 4855, 4826, 4835, 4821, 4837, 4820, 4839, 4830, 4799,
4818, 4835, 4854, 4832, 4849, 4830, 4849, 4833, 4880, 4862, 4832, 4843, 4827, 4846, 4826, 4848, 4837, 4805,
4870, 4882, 4904, 4879, 4898, 4877, 4899, 4882, 4930, 4912, 4879, 4893, 4874, 4896, 4874, 4898, 4885, 4857,
4854, 4860, 4876, 4851, 4868, 4849, 4870, 4857, 4904, 4876, 4845, 4855, 4839, 4857, 4837, 4861, 4855, 4833,
4995, 4993, 4986, 4967, 4964, 4964, 4976, 4974, 5017, 4996, 4971, 4967, 4958, 4968, 4961, 4982, 5002, 4989,
#if TOUCH_KEY_NUM > 0
13000, 13000, 13000,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_Open_Rawdata_N[40 * 40] = {
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500, 6500,
3821, 3827, 3839, 3826, 3841, 3827, 3839, 3831, 3851, 3845, 3828, 3837, 3825, 3835, 3825, 3836, 3822, 3819,
3740, 3745, 3756, 3741, 3756, 3743, 3755, 3746, 3766, 3762, 3744, 3754, 3743, 3754, 3743, 3755, 3741, 3741,
3731, 3733, 3745, 3730, 3744, 3731, 3744, 3734, 3755, 3753, 3735, 3744, 3733, 3744, 3733, 3744, 3732, 3732,
3719, 3720, 3731, 3718, 3730, 3719, 3730, 3721, 3741, 3731, 3714, 3723, 3712, 3723, 3712, 3722, 3711, 3710,
3716, 3719, 3729, 3716, 3728, 3717, 3728, 3719, 3739, 3735, 3718, 3727, 3716, 3727, 3716, 3726, 3715, 3714,
3718, 3720, 3730, 3718, 3729, 3719, 3729, 3721, 3740, 3733, 3716, 3724, 3715, 3724, 3714, 3724, 3714, 3711,
3716, 3719, 3729, 3717, 3728, 3718, 3727, 3720, 3738, 3732, 3717, 3724, 3715, 3724, 3715, 3723, 3714, 3710,
3716, 3719, 3728, 3717, 3727, 3718, 3727, 3720, 3737, 3732, 3717, 3723, 3715, 3723, 3714, 3722, 3714, 3709,
3714, 3718, 3725, 3716, 3724, 3716, 3724, 3718, 3735, 3733, 3719, 3723, 3716, 3724, 3716, 3723, 3716, 3710,
3719, 3723, 3729, 3721, 3729, 3721, 3728, 3723, 3739, 3733, 3719, 3723, 3717, 3723, 3716, 3723, 3717, 3710,
3716, 3720, 3727, 3718, 3725, 3719, 3725, 3720, 3736, 3731, 3717, 3721, 3715, 3721, 3714, 3720, 3715, 3707,
3715, 3719, 3725, 3717, 3724, 3718, 3724, 3719, 3735, 3732, 3718, 3722, 3715, 3723, 3715, 3721, 3716, 3709,
3716, 3720, 3726, 3718, 3725, 3719, 3725, 3720, 3736, 3730, 3716, 3720, 3714, 3721, 3713, 3719, 3714, 3706,
3715, 3719, 3725, 3718, 3724, 3718, 3724, 3719, 3735, 3732, 3718, 3722, 3716, 3722, 3715, 3721, 3716, 3708,
3715, 3719, 3725, 3717, 3724, 3718, 3724, 3719, 3735, 3728, 3715, 3718, 3712, 3719, 3712, 3718, 3713, 3704,
3714, 3718, 3724, 3716, 3723, 3717, 3723, 3718, 3733, 3729, 3716, 3719, 3714, 3720, 3713, 3719, 3714, 3705,
3712, 3718, 3725, 3717, 3723, 3717, 3723, 3718, 3734, 3725, 3714, 3718, 3713, 3719, 3712, 3718, 3713, 3705,
3711, 3716, 3723, 3715, 3721, 3715, 3721, 3716, 3731, 3729, 3718, 3721, 3716, 3722, 3715, 3721, 3717, 3707,
3713, 3718, 3724, 3716, 3722, 3716, 3723, 3718, 3733, 3725, 3713, 3716, 3712, 3718, 3711, 3717, 3713, 3704,
3708, 3713, 3720, 3712, 3718, 3712, 3718, 3714, 3729, 3725, 3713, 3716, 3712, 3718, 3711, 3717, 3713, 3703,
3709, 3714, 3720, 3713, 3719, 3713, 3719, 3714, 3729, 3724, 3712, 3715, 3711, 3716, 3710, 3716, 3712, 3702,
3710, 3714, 3721, 3713, 3719, 3713, 3719, 3714, 3730, 3723, 3712, 3714, 3710, 3715, 3709, 3715, 3712, 3702,
3704, 3709, 3715, 3708, 3713, 3708, 3714, 3709, 3724, 3721, 3710, 3712, 3708, 3714, 3707, 3713, 3710, 3700,
3706, 3711, 3718, 3711, 3715, 3710, 3715, 3711, 3727, 3718, 3707, 3710, 3706, 3711, 3705, 3711, 3708, 3697,
3705, 3710, 3716, 3709, 3714, 3709, 3714, 3710, 3725, 3718, 3706, 3709, 3705, 3710, 3704, 3710, 3707, 3696,
3703, 3708, 3714, 3707, 3712, 3707, 3712, 3708, 3723, 3718, 3707, 3710, 3705, 3711, 3705, 3711, 3709, 3698,
3703, 3709, 3715, 3707, 3712, 3707, 3712, 3708, 3723, 3716, 3706, 3709, 3704, 3710, 3704, 3710, 3708, 3696,
3702, 3707, 3714, 3706, 3711, 3706, 3712, 3707, 3722, 3715, 3704, 3707, 3703, 3709, 3702, 3709, 3706, 3695,
3702, 3707, 3714, 3706, 3713, 3706, 3713, 3707, 3724, 3718, 3706, 3711, 3705, 3712, 3704, 3712, 3709, 3697,
3720, 3724, 3732, 3723, 3730, 3723, 3731, 3724, 3742, 3736, 3723, 3729, 3722, 3730, 3722, 3730, 3725, 3715,
3714, 3716, 3722, 3713, 3720, 3713, 3720, 3715, 3732, 3722, 3711, 3715, 3709, 3715, 3709, 3717, 3715, 3707,
3765, 3765, 3762, 3755, 3754, 3754, 3758, 3758, 3773, 3766, 3757, 3755, 3752, 3756, 3753, 3760, 3768, 3763,
#if TOUCH_KEY_NUM > 0
6500, 6500, 6500,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_FW_Rawdata_P[40 * 40] = {
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
#if TOUCH_KEY_NUM > 0
2000, 2000, 2000,
800, 800, 800,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
@ -410,309 +195,23 @@ static int32_t PS_Config_Lmt_FW_Rawdata_N[40 * 40] = {
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_FW_CC_P[40 * 40] = {
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
#if TOUCH_KEY_NUM > 0
38, 38, 38,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_FW_CC_P = 130;
static int32_t PS_Config_Lmt_FW_CC_N = 80;
static int32_t PS_Config_Lmt_Key_FW_CC_P = 38;
static int32_t PS_Config_Lmt_Key_FW_CC_N = 9;
static int32_t PS_Config_Lmt_FW_CC_I_P = 25;
static int32_t PS_Config_Lmt_FW_CC_I_N;
static int32_t PS_Config_Lmt_FW_CC_Q_P = 25;
static int32_t PS_Config_Lmt_FW_CC_Q_N;
static int32_t PS_Config_Lmt_Key_FW_CC_I_P = 25;
static int32_t PS_Config_Lmt_Key_FW_CC_I_N;
static int32_t PS_Config_Lmt_Key_FW_CC_Q_P = 25;
static int32_t PS_Config_Lmt_Key_FW_CC_Q_N;
static int32_t PS_Config_Lmt_FW_CC_N[40 * 40] = {
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
#if TOUCH_KEY_NUM > 0
9, 9, 9,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_FW_CC_I_P[40 * 40] = {
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
#if TOUCH_KEY_NUM > 0
25, 25, 25,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_FW_CC_I_N[40 * 40] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#if TOUCH_KEY_NUM > 0
0, 0, 0,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_FW_CC_Q_P[40 * 40] = {
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
#if TOUCH_KEY_NUM > 0
25, 25, 25,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_FW_CC_Q_N[40 * 40] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#if TOUCH_KEY_NUM > 0
0, 0, 0,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_FW_Diff_P[40 * 40] = {
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
#if TOUCH_KEY_NUM > 0
35, 35, 35,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_FW_Diff_N[40 * 40] = {
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
#if TOUCH_KEY_NUM > 0
-35, -35, -35,
#endif /* #if TOUCH_KEY_NUM > 0 */
};
static int32_t PS_Config_Lmt_FW_Diff_P = 35;
static int32_t PS_Config_Lmt_FW_Diff_N = -35;
static int32_t PS_Config_Lmt_Key_FW_Diff_P = 35;
static int32_t PS_Config_Lmt_Key_FW_Diff_N = -35;
static int32_t PS_Config_Diff_Test_Frame = 50;