touch:nt36xxx: NT36525c improvement

Capri plus: support NT36525c IC
enlarge rbuf in ts_data
NO_PROP_NEEDED: needn't for shm2018

Change-Id: Iedc76223f0f53a6baf66b1d323132a263e40bf97
Signed-off-by: hujing3 <hujing3@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1769818
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
hujing3 2020-10-09 10:28:03 +08:00 • committed by Jing Hu
commit df5ea75b7d
3 changed files with 26 additions and 14 deletions

View file

@ -262,7 +262,8 @@ static inline int32_t spi_read_write(struct spi_device *client, uint8_t *buf, si
.len = len,
};
memcpy(ts->xbuf, buf, len + DUMMY_BYTES);
memset(ts->xbuf, 0, len + DUMMY_BYTES);
memcpy(ts->xbuf, buf, len);
switch (rw) {
case NVTREAD:
@ -2137,11 +2138,15 @@ static int32_t nvt_ts_probe(struct spi_device *client)
ts->xbuf = (uint8_t *)kzalloc((NVT_TRANSFER_LEN+2), GFP_KERNEL);
if(ts->xbuf == NULL) {
NVT_ERR("kzalloc for xbuf failed!\n");
if (ts) {
kfree(ts);
ts = NULL;
}
return -ENOMEM;
ret = -ENOMEM;
goto err_malloc_xbuf;
}
ts->rbuf = (uint8_t *)kzalloc(NVT_READ_LEN, GFP_KERNEL);
if(ts->rbuf == NULL) {
NVT_ERR("kzalloc for rbuf failed!\n");
ret = -ENOMEM;
goto err_malloc_rbuf;
}
ts->client = client;
@ -2603,6 +2608,16 @@ err_gpio_config_failed:
err_spi_setup:
err_ckeck_full_duplex:
spi_set_drvdata(client, NULL);
if (ts->rbuf) {
kfree(ts->rbuf);
ts->rbuf = NULL;
}
err_malloc_rbuf:
if (ts->xbuf) {
kfree(ts->xbuf);
ts->xbuf = NULL;
}
err_malloc_xbuf:
if (ts) {
kfree(ts);
ts = NULL;

View file

@ -85,7 +85,7 @@
//---Touch info.---
#define TOUCH_COORDS_ARR_SIZE 2
#define TOUCH_DEFAULT_MAX_WIDTH 720
#define TOUCH_DEFAULT_MAX_HEIGHT 1560
#define TOUCH_DEFAULT_MAX_HEIGHT 1600
#define TOUCH_MAX_FINGER_NUM 10
#define TOUCH_KEY_NUM 0
#if TOUCH_KEY_NUM > 0
@ -183,7 +183,7 @@ struct nvt_ts_data {
uint8_t carrier_system;
uint8_t hw_crc;
uint16_t nvt_pid;
uint8_t rbuf[1025];
uint8_t *rbuf;
uint8_t *xbuf;
struct mutex xbuf_lock;
bool irq_enabled;
@ -265,6 +265,7 @@ typedef enum {
#define DUMMY_BYTES (1)
#define NVT_TRANSFER_LEN (63*1024)
#define NVT_READ_LEN (2*1024)
typedef enum {
NVTWRITE = 0,

View file

@ -452,7 +452,7 @@ static int32_t nvt_polling_hand_shake_status(void)
{
uint8_t buf[8] = {0};
int32_t i = 0;
const int32_t retry = 70;
const int32_t retry = 250;
for (i = 0; i < retry; i++) {
//---set xdata index to EVENT BUF ADDR---
@ -1091,11 +1091,7 @@ static int32_t c_show_selftest(struct seq_file *m, void *v)
nvt_mp_seq_printf(m, "FW Version: %d\n\n", fw_ver);
nvt_mp_seq_printf(m, "Short Test");
if ((TestResult_Short == 0) || (TestResult_Short == 1)) {
print_selftest_result(m, TestResult_Short, RecordResult_Short, RawData_Short, X_Channel, Y_Channel);
} else { // TestResult_Short is -1
print_selftest_result(m, TestResult_Short, RecordResult_Short, RawData_Short, X_Channel, Y_Channel);
}
print_selftest_result(m, TestResult_Short, RecordResult_Short, RawData_Short, X_Channel, Y_Channel);
nvt_mp_seq_printf(m, "Open Test");
print_selftest_result(m, TestResult_Open, RecordResult_Open, RawData_Open, X_Channel, Y_Channel);